PagedList Pennington.Content
A single page of items with the bookkeeping the Pagination component needs to render prev/next controls and numbered page links.
Properties
HasNextbool- True when a page exists after
Page. HasPreviousbool- True when a page exists before
Page. ItemsIReadOnlyList<T>- Items in this page slice.
Pageint- 1-based page index this slice represents.
PageSizeint- Items per page.
TotalItemsint- Total item count across all pages.
TotalPagesint- Total page count. At least
1even whenTotalItemsis zero.
Constructors
PagedList
#public PagedList`1(IReadOnlyList<T> Items, int Page, int PageSize, int TotalItems)
A single page of items with the bookkeeping the Pagination component needs to render prev/next controls and numbered page links.
Parameters
ItemsIReadOnlyList<T>- Items in this page slice.
Pageint- 1-based page index this slice represents.
PageSizeint- Items per page.
TotalItemsint- Total item count across all pages.
Pennington.Content.PagedList
namespace Pennington.Content;
/// A single page of items with the bookkeeping the Pagination component needs to render prev/next controls and numbered page links.
public record PagedList
{
/// True when a page exists after Page.
public bool HasNext { get; }
/// True when a page exists before Page.
public bool HasPrevious { get; }
/// Items in this page slice.
public IReadOnlyList<T> Items { get; set; }
/// 1-based page index this slice represents.
public int Page { get; set; }
/// A single page of items with the bookkeeping the Pagination component needs to render prev/next controls and numbered page links.
public PagedList`1(IReadOnlyList<T> Items, int Page, int PageSize, int TotalItems)
;
/// Items per page.
public int PageSize { get; set; }
/// Total item count across all pages.
public int TotalItems { get; set; }
/// Total page count. At least 1 even when TotalItems is zero.
public int TotalPages { get; }
}