Search documentationEsc

OffsetByPageNumberSpecification<TItem>

A specification used for the Offset and Limit pattern

Namespace: Microsoft.Azure.CosmosRepository.Specification
Kind: class

A specification used for the Offset and Limit pattern

public class OffsetByPageNumberSpecification<TItem> : BaseSpecification<TItem, IPageQueryResult<TItem>>, ISpecification<TItem, IPageQueryResult<TItem>> where TItem : IItem

Type parameters

NameDescription
TItem

Example

Members

Constructor

OffsetByPageNumberSpecification<TItem>.OffsetByPageNumberSpecification(int, int)

Helper ctor to set page number and page size

public OffsetByPageNumberSpecification(int pageNumber = 1, int pageSize = 25)

Parameters

NameTypeDescription
pageNumberInt32
pageSizeInt32

Methods

OffsetByPageNumberSpecification<TItem>.NextPage()

Update the specification to get the next page of the result

public void NextPage()

OffsetByPageNumberSpecification<TItem>.PreviousPage()

Update the specification to get the previous page of the result

public void PreviousPage()

OffsetByPageNumberSpecification<TItem>.PostProcessingAction(IReadOnlyList<TItem>, int, double, string?)

Processing for updating the query result before returning it from the repository. Given the methods input it should generate the specified TResult />

public override IPageQueryResult<TItem> PostProcessingAction(IReadOnlyList<TItem> queryResult, int totalCount, double charge, string? continuationToken)

Parameters

NameTypeDescription
queryResultIReadOnlyList{{TItem}}
totalCountInt32
chargeDouble
continuationTokenString

ReturnsIPageQueryResult{{TItem}}