Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        

# nmct.own.pagination
Paged Lists inspirated by many developers online

Usage:
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