Click or drag to resize

CollectionExtensionsToPagedListT Method

Gets a PagedListT to paginate source enumeration for a given page and specified pageSize.

Namespace: GSF.Collections
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.258-beta+f8b6aa3dbfe0b4cc2b0b0760dd5d2a3dd4f59d09
Syntax
public static PagedList<T> ToPagedList<T>(
	this IEnumerable<T> source,
	int page,
	int pageSize,
	int count = -1
)
View Source

Parameters

source  IEnumerableT
Source enumeration to paginate.
page  Int32
Page number (1-based).
pageSize  Int32
Page size.
count  Int32  (Optional)
Total records in source if known.

Type Parameters

T
Type of IEnumerableT to paginate.

Return Value

PagedListT
Set of items on a given page for specified pageSize.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableT. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
If count is known or can be calculated early, specify the value in the count parameter as an optimization to prevent a full enumeration on source to get a count.
See Also