Table of Contents

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

pageIndex int

The one-based index of the page to retrieve. Must be greater than or equal to 1.

pageSize int

The number of items per page. Must be greater than or equal to 1.

Exceptions

ArgumentOutOfRangeException

Thrown when pageIndex or pageSize is less than 1.

Fields

DefaultPageSize

The default number of items per page when none is specified.

public const int DefaultPageSize = 20

Field Value

int

Properties

PageIndex

Gets the one-based index of the page to retrieve. The first page is 1.

public int PageIndex { get; }

Property Value

int

PageSize

Gets the number of items per page.

public int PageSize { get; }

Property Value

int

Skip

Gets the number of items to skip before the current page, computed from PageIndex and PageSize.

public int Skip { get; }

Property Value

int

Take

Gets the number of items to take for the current page. Equivalent to PageSize.

public int Take { get; }

Property Value

int

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

pageIndex int

The one-based index of the page to retrieve.

pageSize int

The number of items per page.

Returns

PageRequest

A new PageRequest.