- 优化 IncludeMany 级联查询支持异步适配(之前是同步方式);

This commit is contained in:
28810
2019-12-03 21:16:40 +08:00
parent 46dcd226ff
commit 8c770a3ffb
9 changed files with 416 additions and 184 deletions

View File

@ -210,5 +210,16 @@ public static partial class FreeSqlGlobalExtensions
select.SetList(list);
return list;
}
#if net40
#else
async public static System.Threading.Tasks.Task<List<T1>> IncludeManyAsync<T1, TNavigate>(this List<T1> list, IFreeSql orm, Expression<Func<T1, IEnumerable<TNavigate>>> navigateSelector, Action<ISelect<TNavigate>> then = null) where T1 : class where TNavigate : class
{
if (list == null || list.Any() == false) return list;
var select = orm.Select<T1>().IncludeMany(navigateSelector, then) as FreeSql.Internal.CommonProvider.Select1Provider<T1>;
await select.SetListAsync(list);
return list;
}
#endif
#endregion
}