Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stijnmoreels/nmct.own.pagination
Simple Pagination Project
https://github.com/stijnmoreels/nmct.own.pagination
Last synced: 26 days ago
JSON representation
Simple Pagination Project
- Host: GitHub
- URL: https://github.com/stijnmoreels/nmct.own.pagination
- Owner: stijnmoreels
- Created: 2015-06-29T08:18:02.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2022-11-26T10:52:55.000Z (almost 2 years ago)
- Last Synced: 2023-02-28T18:15:32.023Z (over 1 year ago)
- Language: C#
- Homepage:
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nmct.own.pagination
Paged Lists inspirated by many developers onlineUsage:
Add these files to your project: [PagedList] (https://github.com/stijnmoreels/nmct.own.pagination/blob/master/nmct.own.pagination.core/PagedList.cs) & [PagedListExtension]
(https://github.com/stijnmoreels/nmct.own.pagination/blob/master/nmct.own.pagination.core/PagedListExtension.cs)## Example list
```
IEnumerable products = Product.GetProducts();
```## 1. First approach
```
PagedList pagedList = new PagedList(products);PagedList firstPage = pagedList.GetPage(1);
PagedList secondPage = pagedList.GetPage(2);
```## 2. Second approach (Extension Methods)
Add namespace "PagedListExtensions" to your file```
using PagedListExtensions;
``````
PagedList fourthPage = products.ToPagedList(4);
PagedList fifthPage = products.ToPagedList(5);
```Thank you