Пример #1
0
        internal static Task <T> SingleAsync <T>(this IQueryable <T> queryable)
        {
            if (queryable is IMongoQueryable <T> mongoQueryable)
            {
                return(MongoQueryable.SingleAsync(mongoQueryable));
            }

            return(Task.FromResult(Queryable.Single(queryable)));
        }
Пример #2
0
        internal static Task <T> SingleAsync <T>(this IQueryable <T> queryable, Expression <Func <T, bool> > filter)
        {
            if (queryable is IMongoQueryable <T> mongoQueryable)
            {
                return(MongoQueryable.SingleAsync(mongoQueryable, filter));
            }

            return(Task.FromResult(Queryable.Single(queryable, filter)));
        }
Пример #3
0
 public static Task <TEntity> SingleAsync <TEntity>(this IQueryable <TEntity> source, CancellationToken cancellationToken = default)
 => MongoQueryable.SingleAsync((IMongoQueryable <TEntity>)source, cancellationToken);