initial commit
This commit is contained in:
19
Data/PagingData.cs
Normal file
19
Data/PagingData.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace Library;
|
||||
|
||||
public class PagingData
|
||||
{
|
||||
public int CurrentPage { init; get; } = 0;
|
||||
public int LastPage { init; get; } = 0;
|
||||
public int TotalPages { init; get; } = 0;
|
||||
|
||||
private readonly string m_BaseURL = "";
|
||||
public string Url( int page ) => m_BaseURL + page.ToString( );
|
||||
|
||||
public PagingData( string base_url , int current_page , int total_items , int items_per_page )
|
||||
{
|
||||
m_BaseURL = base_url;
|
||||
CurrentPage = current_page;
|
||||
LastPage = ( total_items - 1 ) / items_per_page;
|
||||
TotalPages = ( total_items + items_per_page - 1 ) / items_per_page;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user