cinu
This commit is contained in:
14
RS_system/Models/ViewModels/PaginatedViewModel.cs
Normal file
14
RS_system/Models/ViewModels/PaginatedViewModel.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Rs_system.Models.ViewModels;
|
||||
|
||||
public class PaginatedViewModel<T>
|
||||
{
|
||||
public List<T> Items { get; set; } = new();
|
||||
public int CurrentPage { get; set; }
|
||||
public int PageSize { get; set; }
|
||||
public int TotalItems { get; set; }
|
||||
public int TotalPages => (int)Math.Ceiling((double)TotalItems / PageSize);
|
||||
public string? SearchQuery { get; set; }
|
||||
|
||||
public bool HasPreviousPage => CurrentPage > 1;
|
||||
public bool HasNextPage => CurrentPage < TotalPages;
|
||||
}
|
||||
Reference in New Issue
Block a user