public static async Task <T> SingleOrDefaultAsyncOk <T>(
     this IQueryable <T> query,
     CancellationToken cancellationToken = default)
 =>
 query.Provider.GetType() == typeof(NHibernate.Linq.DefaultQueryProvider) ?
 await LinqExtensionMethods.SingleOrDefaultAsync(query, cancellationToken)
     :
 query.SingleOrDefault();
예제 #2
0
 public Task <TSource> SingleOrDefaultAsync <TSource>(IQueryable <TSource> source, CancellationToken cancellationToken = default(CancellationToken))
 => LinqExtensionMethods.SingleOrDefaultAsync(source, cancellationToken);
예제 #3
0
 public Task <TSource> SingleOrDefaultAsync <TSource>(IQueryable <TSource> source, Expression <Func <TSource, bool> > predicate, CancellationToken cancellationToken = default(CancellationToken))
 => LinqExtensionMethods.SingleOrDefaultAsync(source, predicate, cancellationToken);