Class PaginationHelper
Provides helper methods to compute pagination metadata from item count and page settings.
Inherited Members
Namespace: DataWeb.Structure
Assembly: DataWeb.Core.dll
Syntax
public static class PaginationHelper
Methods
GetPaginationInfo(int, long, long, int?)
Computes pagination info from the given parameters, clamping the page index within valid bounds.
Declaration
public static PaginationInfo GetPaginationInfo(int pageSize, long pageIndex, long itemCount, int? pageMaxCount = null)
Parameters
| Type | Name | Description |
|---|---|---|
| int | pageSize | The number of items per page. Must be greater than zero. |
| long | pageIndex | The zero-based index of the requested page. |
| long | itemCount | The total number of items. |
| int? | pageMaxCount | Optional maximum number of navigable pages. When set, |
Returns
| Type | Description |
|---|---|
| PaginationInfo | A PaginationInfo instance with all pagination properties calculated and boundary-checked. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown when |