15 lines
484 B
C#
15 lines
484 B
C#
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;
|
|
}
|