Class Page<T>
- Namespace
- Olve.Utilities.Paginations
- Assembly
- Olve.Utilities.dll
A single page of items from a larger collection, with metadata describing position within that collection.
public sealed record Page<T> : IEquatable<Page<T>>
Type Parameters
T
- Inheritance
-
Page<T>
- Implements
-
IEquatable<Page<T>>
- Inherited Members
Constructors
Page(IReadOnlyList<T>, int, int, int)
A single page of items from a larger collection, with metadata describing position within that collection.
public Page(IReadOnlyList<T> Items, int PageNumber, int PageSize, int TotalCount)
Parameters
ItemsIReadOnlyList<T>The items on this page.
PageNumberintZero-based index of this page.
PageSizeintMaximum number of items per page.
TotalCountintTotal number of items across all pages.
Properties
HasNextPage
Whether another page exists after this one.
public bool HasNextPage { get; }
Property Value
Items
The items on this page.
public IReadOnlyList<T> Items { get; init; }
Property Value
Next
The Pagination that would fetch the next page, or
null when this is the last page.
public Pagination? Next { get; }
Property Value
PageNumber
Zero-based index of this page.
public int PageNumber { get; init; }
Property Value
PageSize
Maximum number of items per page.
public int PageSize { get; init; }
Property Value
TotalCount
Total number of items across all pages.
public int TotalCount { get; init; }
Property Value
TotalPages
Total number of pages. Zero when PageSize is zero.
public int TotalPages { get; }
Property Value
Methods
ToSlice()
Converts this page to the equivalent Slice<T>. This is always possible.
public Slice<T> ToSlice()