Created
December 14, 2015 11:34
-
-
Save VisualBean/0d981184496cce96cde7 to your computer and use it in GitHub Desktop.
A Very simple example of manual pagination
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpGet] | |
public IHttpResult Books(int page = 1, int pageSize = 20) | |
{ | |
List<Book> books = BooksRepository.AllBooks(); | |
return books.Take(pageSize).Skip((page-1)*pageSize).ToList(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment