Class PagedCollection<T>
Represents a paged collection of items of type T
.
Inherited Members
Namespace: Innovt.Core.Collections
Assembly: Innovt.Core.dll
Syntax
public class PagedCollection<T> : IPagedCollection<T>, IPagedCollection
Type Parameters
Name | Description |
---|---|
T | The type of items in the collection. |
Remarks
This class implements the IPagedCollection<T> interface to represent a paged collection of items. It provides properties and methods to work with paged collections, including pagination information and navigation.
Constructors
| Edit this page View SourcePagedCollection()
Initializes a new instance of the PagedCollection<T> class with an empty collection.
Declaration
public PagedCollection()
PagedCollection(IEnumerable<T>)
Initializes a new instance of the PagedCollection<T> class with the specified collection of items.
Declaration
public PagedCollection(IEnumerable<T> collection)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | collection | The collection of items to be paged. |
PagedCollection(IEnumerable<T>, int?, int?)
Initializes a new instance of the PagedCollection<T> class with the specified collection of items, page number, and page size.
Declaration
public PagedCollection(IEnumerable<T> collection, int? page = null, int? pageSize = null)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | collection | The collection of items to be paged. |
int? | page | The current page number. |
int? | pageSize | The number of items per page. |
PagedCollection(IEnumerable<T>, string, int?)
Initializes a new instance of the PagedCollection<T> class with the specified collection of items, page number, and page size.
Declaration
public PagedCollection(IEnumerable<T> collection, string page = null, int? pageSize = null)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | collection | The collection of items to be paged. |
string | page | The current page number as a string. |
int? | pageSize | The number of items per page. |
Properties
| Edit this page View SourceIsNumberPagination
Gets a value indicating whether the page number is a valid numeric representation.
Declaration
public bool IsNumberPagination { get; }
Property Value
Type | Description |
---|---|
bool |
Items
Gets or sets the collection of items in the current page.
Declaration
public IEnumerable<T> Items { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable<T> |
Page
Gets or sets the current page number.
Declaration
public string Page { get; set; }
Property Value
Type | Description |
---|---|
string |
PageCount
Gets the total number of pages in the paged collection.
Declaration
public int PageCount { get; }
Property Value
Type | Description |
---|---|
int |
PageSize
Gets or sets the number of items per page.
Declaration
public int PageSize { get; set; }
Property Value
Type | Description |
---|---|
int |
TotalRecords
Gets or sets the total number of records in the entire collection.
Declaration
public int TotalRecords { get; set; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceHasNext()
Determines whether there is a next page in the paged collection.
Declaration
public bool HasNext()
Returns
Type | Description |
---|---|
bool |
|
HasPrevious()
Determines whether there is a previous page in the paged collection.
Declaration
public bool HasPrevious()
Returns
Type | Description |
---|---|
bool |
|