Class PageRequest
- Namespace
- eQuantic.Core.Data.Repository
- Assembly
- eQuantic.Core.Data.dll
Represents a request for a single page of data, expressed as a one-based page index and a page size.
public sealed class PageRequest
- Inheritance
-
PageRequest
- Inherited Members
Constructors
PageRequest(int, int)
Initializes a new instance of the PageRequest class.
public PageRequest(int pageIndex = 1, int pageSize = 20)
Parameters
pageIndexintThe one-based index of the page to retrieve. Must be greater than or equal to 1.
pageSizeintThe number of items per page. Must be greater than or equal to 1.
Exceptions
- ArgumentOutOfRangeException
Thrown when
pageIndexorpageSizeis less than 1.
Fields
DefaultPageSize
The default number of items per page when none is specified.
public const int DefaultPageSize = 20
Field Value
Properties
PageIndex
Gets the one-based index of the page to retrieve. The first page is 1.
public int PageIndex { get; }
Property Value
PageSize
Gets the number of items per page.
public int PageSize { get; }
Property Value
Skip
public int Skip { get; }
Property Value
Take
Gets the number of items to take for the current page. Equivalent to PageSize.
public int Take { get; }
Property Value
Methods
Of(int, int)
Creates a PageRequest from a one-based page index and page size.
public static PageRequest Of(int pageIndex, int pageSize)
Parameters
pageIndexintThe one-based index of the page to retrieve.
pageSizeintThe number of items per page.
Returns
- PageRequest
A new PageRequest.