Table of Contents

Class Pagination<T>

Namespace
XENBIT.ResQueServe.Core.Models
Assembly
RQS.Core.dll

Represents pagination details for a collection of items and includes information about current page, total pages, page size, total items, and the items themselves.

public record Pagination<T> : IEquatable<Pagination<T>>

Type Parameters

T

The type of the items contained in the paginated collection.

Inheritance
Pagination<T>
Implements
Inherited Members
Extension Methods

Constructors

Pagination()

public Pagination()

Pagination(Pagination<T>)

[SetsRequiredMembers]
protected Pagination(Pagination<T> original)

Parameters

original Pagination<T>

Properties

CurrentPage

Gets the number of the current page in the pagination sequence.

public required int CurrentPage { get; set; }

Property Value

int

Empty

Gets an empty pagination result with no items.

public static Pagination<T> Empty { get; }

Property Value

Pagination<T>

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

Items

Gets the collection of items on the current page.

public required IEnumerable<T> Items { get; set; }

Property Value

IEnumerable<T>

PageSize

Gets the number of items per page.

public required int PageSize { get; set; }

Property Value

int

TotalItems

Gets the total number of items across all pages.

public required int TotalItems { get; set; }

Property Value

int

TotalPages

Gets the total number of pages available.

public required int TotalPages { get; set; }

Property Value

int

Methods

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Equals(Pagination<T>?)

public virtual bool Equals(Pagination<T>? other)

Parameters

other Pagination<T>

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

GetReadOnly()

public IReadOnlyCollection<T> GetReadOnly()

Returns

IReadOnlyCollection<T>

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

Returns a string representation of the pagination details.

public override string ToString()

Returns

string

A string in the format "Page {CurrentPage} of {TotalPages}".

Operators

operator ==(Pagination<T>?, Pagination<T>?)

public static bool operator ==(Pagination<T>? left, Pagination<T>? right)

Parameters

left Pagination<T>
right Pagination<T>

Returns

bool

operator !=(Pagination<T>?, Pagination<T>?)

public static bool operator !=(Pagination<T>? left, Pagination<T>? right)

Parameters

left Pagination<T>
right Pagination<T>

Returns

bool