示例#1
0
        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());
     }
 }
示例#4
0
 public Task <bool> AnyAsync(Expression <Func <TEntity, bool> > predicate, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(MongoQueryable.AnyAsync(Collection.AsQueryable(), predicate, cancellationToken));
 }
示例#5
0
 public static Task <bool> AnyAsync <TEntity>(this IQueryable <TEntity> source, CancellationToken cancellationToken = default)
 => MongoQueryable.AnyAsync((IMongoQueryable <TEntity>)source, cancellationToken);