Skip to content

Instantly share code, notes, and snippets.

@VisualBean
Created December 14, 2015 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VisualBean/0d981184496cce96cde7 to your computer and use it in GitHub Desktop.
Save VisualBean/0d981184496cce96cde7 to your computer and use it in GitHub Desktop.
A Very simple example of manual pagination
[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