Exemple #1
0
 /// <summary>
 /// Applies the cursor pagination algorithm to the <paramref name="enumerable"/>.
 /// </summary>
 /// <param name="enumerable">
 /// The enumerable on which the the cursor pagination algorithm shall be applied to.
 /// </param>
 /// <param name="context">
 /// The field resolver context.
 /// </param>
 /// <param name="defaultPageSize">
 /// The default page size if no boundaries are set.
 /// </param>
 /// <param name="totalCount">
 /// The total count if already known.
 /// </param>
 /// <param name="cancellationToken">
 /// The cancellation token.
 /// </param>
 /// <typeparam name="TEntity">
 /// The entity type.
 /// </typeparam>
 /// <returns>
 /// Returns a connection instance that represents the result of applying the
 /// cursor paging algorithm to the provided <paramref name="enumerable"/>.
 /// </returns>
 public static ValueTask <Connection <TEntity> > ApplyCursorPaginationAsync <TEntity>(
     this System.Collections.Generic.IEnumerable <TEntity> enumerable,
     IResolverContext context,
     int?defaultPageSize = null,
     int?totalCount      = null,
     CancellationToken cancellationToken = default)
 => ApplyCursorPaginationAsync(
     enumerable.AsQueryable(),
     context,
     defaultPageSize,
     totalCount,
     cancellationToken);