Pagination

On Server Side:

Once you have an IQueryable<T> which has your stored command it it (i.e. the where and ordey by clauses) use .Skip and .Take to get the pages. 

Pass in:

  • pageNumber 
  • pageSize

Pass out:

  • Items - so they can be displayed
  • CurrentPage
  • ItemsPerPage
  • TotalItems - so this can be displayeded
  • TotalPages - so this can provide other pages to load

On Client Side

Use PaginationModule from ngx-bootstrap.  This will provide navigation around the pages.
When loading a new page, set only the TotalItems and TotalPages to prevent triggering a seconp page load.





Comments

Popular posts from this blog

Understanding the technologies - Angular 8 and ASP.NET Web API Core 3

Bits and bobs