Esempio n. 1
0
        protected override async ValueTask <IReadOnlyList <TEntity> > ExecuteAsync(
            IMongoPagingContainer <TEntity> query,
            CancellationToken cancellationToken)
        {
            List <TEntity> result = await query.ToListAsync(cancellationToken);

            return(result);
        }
            protected override ValueTask <CollectionSegment> SliceAsync(
                IResolverContext context,
                object source,
                OffsetPagingArguments arguments)
            {
                IMongoPagingContainer <TEntity> f = CreatePagingContainer(source);

                return(ResolveAsync(context, f, arguments));
            }
Esempio n. 3
0
            protected override ValueTask <Connection> SliceAsync(
                IResolverContext context,
                object source,
                CursorPagingArguments arguments)
            {
                IMongoPagingContainer <TEntity> f = CreatePagingContainer(source);

                return(ResolveAsync(f, arguments, context.RequestAborted));
            }
 protected override ValueTask <IReadOnlyList <Edge <TEntity> > > ExecuteAsync(
     IMongoPagingContainer <TEntity> query,
     int offset,
     CancellationToken cancellationToken)
 => query.ExecuteQueryAsync(offset, cancellationToken);
 protected override async ValueTask <int> CountAsync(
     IMongoPagingContainer <TEntity> query,
     CancellationToken cancellationToken)
 => await query.CountAsync(cancellationToken).ConfigureAwait(false);
 protected override IMongoPagingContainer <TEntity> ApplyTake(
     IMongoPagingContainer <TEntity> query,
     int take)
 => query.Take(take);
 protected override IMongoPagingContainer <TEntity> ApplySkip(
     IMongoPagingContainer <TEntity> query,
     int skip)
 => query.Skip(skip);