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 : IItemType parameters
| Name | Description |
|---|---|
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
| Name | Type | Description |
|---|---|---|
pageNumber | Int32 | — |
pageSize | Int32 | — |
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
| Name | Type | Description |
|---|---|---|
queryResult | IReadOnlyList{{TItem}} | — |
totalCount | Int32 | — |
charge | Double | — |
continuationToken | String | — |
Returns — IPageQueryResult{{TItem}}