public static async Task <List <T> > ToListAsyncOk <T>( this IQueryable <T> query, CancellationToken cancellationToken = default) => query.Provider.GetType() == typeof(NHibernate.Linq.DefaultQueryProvider) ? await LinqExtensionMethods.ToListAsync(query, cancellationToken) : query.ToList();
private Task <IList> ToListAsync(dynamic queryable, CancellationToken cancellationToken) { return(queryable is INhQueryProvider?ToListAsyncInternal() : Task.FromResult <IList>(ToList(queryable))); async Task <IList> ToListAsyncInternal() { return(await LinqExtensionMethods.ToListAsync(queryable, cancellationToken)); } }
public Task <List <TSource> > ToListAsync <TSource>(IQueryable <TSource> source, CancellationToken cancellationToken = default(CancellationToken)) => LinqExtensionMethods.ToListAsync(source, cancellationToken);