Class PagedCollectionExtensions
This is an extension implementation that provides ways to enable paging on System.Collections.Generic.IEnumerable<T> sequences.
Inheritance
Namespace: Cuemon.Collections.Generic
Assembly: Cuemon.Core.dll
Syntax
public static class PagedCollectionExtensions
Methods
| Improve this DocToPagedCollection<T>(IEnumerable<T>)
Converts the specified source to a paged data sequence.
Declaration
public static PagedCollection<T> ToPagedCollection<T>(this IEnumerable<T> source)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<T> | source | The source of the sequence to make pageable. |
Returns
| Type | Description |
|---|---|
| PagedCollection<T> | An instance of PagedCollection<T>. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the elements of |
Remarks
The starting page is set to 1 and the page size is determined by DefaultPageSize.
ToPagedCollection<T>(IEnumerable<T>, PagedSettings)
Converts the specified source to a paged data sequence initialized with settings.
Declaration
public static PagedCollection<T> ToPagedCollection<T>(this IEnumerable<T> source, PagedSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<T> | source | The source of the sequence to make pageable. |
| PagedSettings | settings | The settings that specifies the conditions of the converted |
Returns
| Type | Description |
|---|---|
| PagedCollection<T> | An instance of PagedCollection<T> initialized with |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the elements of |
ToPagedCollection<T>(IEnumerable<T>, PagedSettings, Int32)
Converts the specified source to a paged data sequence initialized with settings.
Declaration
public static PagedCollection<T> ToPagedCollection<T>(this IEnumerable<T> source, PagedSettings settings, int totalElementCount)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<T> | source | The source of the sequence to make pageable. |
| PagedSettings | settings | The settings that specifies the conditions of the converted |
| System.Int32 | totalElementCount | The total number of elements in the |
Returns
| Type | Description |
|---|---|
| PagedCollection<T> | An instance of PagedCollection<T> initialized with |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the elements of |
ToPagedCollection<T>(IEnumerable<T>, Int32)
Converts the specified source to a paged data sequence initialized with starting pageNumber.
Declaration
public static PagedCollection<T> ToPagedCollection<T>(this IEnumerable<T> source, int pageNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<T> | source | The source of the sequence to make pageable. |
| System.Int32 | pageNumber | The page number to start with. |
Returns
| Type | Description |
|---|---|
| PagedCollection<T> | An instance of PagedCollection<T>. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the elements of |
Remarks
The page size is determined by DefaultPageSize.
ToPagedCollection<T>(IEnumerable<T>, Int32, Int32)
Converts the specified source to a paged data sequence initialized with starting pageNumber and pageSize.
Declaration
public static PagedCollection<T> ToPagedCollection<T>(this IEnumerable<T> source, int pageNumber, int pageSize)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<T> | source | The source of the sequence to make pageable. |
| System.Int32 | pageNumber | The page number to start with. |
| System.Int32 | pageSize | The number of elements a page can contain. |
Returns
| Type | Description |
|---|---|
| PagedCollection<T> | An instance of PagedCollection<T>. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the elements of |
ToPagedCollection<T>(IEnumerable<T>, Int32, Int32, Int32)
Converts the specified source to a paged data sequence initialized with starting pageNumber and pageSize.
Declaration
public static PagedCollection<T> ToPagedCollection<T>(this IEnumerable<T> source, int pageNumber, int pageSize, int totalElementCount)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<T> | source | The source of the sequence to make pageable. |
| System.Int32 | pageNumber | The page number to start with. |
| System.Int32 | pageSize | The number of elements a page can contain. |
| System.Int32 | totalElementCount | The total number of elements in the |
Returns
| Type | Description |
|---|---|
| PagedCollection<T> | An instance of PagedCollection<T>. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the elements of |