DataWeb
Search Results for

    Show / Hide Table of Contents

    Class PaginationHelper

    Provides helper methods to compute pagination metadata from item count and page settings.

    Inheritance
    object
    PaginationHelper
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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, pageIndex is clamped to pageMaxCount - 1 before page count validation.

    Returns
    Type Description
    PaginationInfo

    A PaginationInfo instance with all pagination properties calculated and boundary-checked.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown when pageSize is less than or equal to zero, or when itemCount is negative.

    In this article
    Back to top Generated by DocFX