internal static Task <bool> AnyAsync <T>(this IQueryable <T> queryable, Expression <Func <T, bool> > filter) { if (queryable is IMongoQueryable <T> mongoQueryable) { return(MongoQueryable.AnyAsync(mongoQueryable, filter)); } return(Task.FromResult(Queryable.Any(queryable, filter))); }
public static async Task <bool> AnyAsync <T>(this IQueryable <T> queryable, Expression <Func <T, bool> > predicate) { if (queryable is IMongoQueryable <T> mongoQueryable) { return(await MongoQueryable.AnyAsync(mongoQueryable, predicate)); } else { return(queryable.Any(predicate)); } }
public static async Task <bool> AnyAsync <T>(this IQueryable <T> queryable) { if (queryable is IMongoQueryable <T> mongoQueryable) { return(await MongoQueryable.AnyAsync(mongoQueryable)); } else { return(queryable.Any()); } }
public Task <bool> AnyAsync(Expression <Func <TEntity, bool> > predicate, CancellationToken cancellationToken = default(CancellationToken)) { return(MongoQueryable.AnyAsync(Collection.AsQueryable(), predicate, cancellationToken)); }
public static Task <bool> AnyAsync <TEntity>(this IQueryable <TEntity> source, CancellationToken cancellationToken = default) => MongoQueryable.AnyAsync((IMongoQueryable <TEntity>)source, cancellationToken);