https://github.com/dataneek/paginable-collections
PaginableCollections is a set of abstractions and extensions used to provide developers with a consistent way to paginate their data across all .NET (and .NET Core) application stacks.
https://github.com/dataneek/paginable-collections
collections extensions page pager paginable paging queryable
Last synced: about 1 year ago
JSON representation
PaginableCollections is a set of abstractions and extensions used to provide developers with a consistent way to paginate their data across all .NET (and .NET Core) application stacks.
- Host: GitHub
- URL: https://github.com/dataneek/paginable-collections
- Owner: dataneek
- License: mit
- Created: 2015-12-01T04:43:31.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-11-15T04:32:28.000Z (over 7 years ago)
- Last Synced: 2024-10-04T11:06:12.364Z (over 1 year ago)
- Topics: collections, extensions, page, pager, paginable, paging, queryable
- Language: C#
- Homepage:
- Size: 234 KB
- Stars: 56
- Watchers: 5
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
PaginableCollections
====================
[](https://ci.appveyor.com/project/neekgreen/paginablecollections)
[](https://www.nuget.org/packages/paginablecollections)
[](https://www.nuget.org/packages/paginablecollections)
[](https://www.codefactor.io/repository/github/neekgreen/paginablecollections)
A light weight pagination framework for .NET and .NET Core.
[](https://img.shields.io/badge/.NET-4.5-blue.svg)
[](https://img.shields.io/badge/.netstandard-1.3-blue.svg)
[](https://img.shields.io/badge/.netstandard-1.3-blue.svg)
### Installing PaginableCollections
You should install [PaginableCollections with NuGet](https://www.nuget.org/packages/paginablecollections):
Install-Package PaginableCollections
This command will download and install PaginableCollections. Let me know if you have questions!
## TD;DR
```csharp
var numbers = new int[] { 2, 4, 5, 1, 6, 8, 2, 0, 4, 3, 4, 1, 5, 9, 7, 0, 2, 4, 8, 9 };
var pageNumber = 2;
var itemCountPerPage = 6;
var paginable = numbers.ToPaginable(pageNumber, itemCountPerPage);
foreach(var t in paginable)
{
Console.WriteLine($"{t.ItemNumber}, {t.Item}");
}
//output
1, 2
2, 0
3, 4
4, 3
5, 4
6, 1