mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-15 05:13:27 +08:00
Code optimization
This commit is contained in:
parent
31743774d7
commit
eeecca7ba2
@ -38,9 +38,9 @@ namespace OrmTest
|
||||
db.Queryable<OperatorInfo>()
|
||||
.Includes(x => x.Roles).Where(x => x.Roles.Any(z=>z.id==1))
|
||||
.ToList();
|
||||
db.Queryable<OperatorInfo>()
|
||||
var list=db.Queryable<OperatorInfo>()
|
||||
.Includes(x => x.Roles).Where(x => x.Roles.Any())
|
||||
.ToList();
|
||||
.ToListAsync().GetAwaiter().GetResult();
|
||||
//db.Queryable<OperatorInfo>()
|
||||
// .Includes(x => x.Roles.Where(z=>z.name==x.realname).ToList())
|
||||
// .ToList();
|
||||
|
@ -2332,6 +2332,13 @@ namespace SqlSugar
|
||||
_InitNavigat(result);
|
||||
return result;
|
||||
}
|
||||
private async Task _InitNavigatAsync<TResult>(List<TResult> result)
|
||||
{
|
||||
if (this.QueryBuilder.Includes != null)
|
||||
{
|
||||
await Task.Run(() => { _InitNavigat(result); });
|
||||
}
|
||||
}
|
||||
|
||||
private void _InitNavigat<TResult>(List<TResult> result)
|
||||
{
|
||||
@ -2366,7 +2373,7 @@ namespace SqlSugar
|
||||
}
|
||||
RestoreMapping();
|
||||
_Mapper(result);
|
||||
await Task.Run(() => { _InitNavigat(result); });
|
||||
await _InitNavigatAsync(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user