Created
October 2, 2018 13:16
-
-
Save mikebrind/7f53ad1d9bd1570c67bca3553b6d21c1 to your computer and use it in GitHub Desktop.
This file contains 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
public class PaginationModel : PageModel | |
{ | |
[BindProperty(SupportsGet = true)] | |
public int CurrentPage { get; set; } = 1; | |
public int Count { get; set; } | |
public int PageSize { get; set; } = 10; | |
public int TotalPages => (int)Math.Ceiling(decimal.Divide(Count, PageSize)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It should be clear that the
GetData
method is there purely to provide some data for the paging demo and is a stand-in for a database. It is not intended to be used with a database. Nevertheless, I'll review the article and see if I can improve it.