kehati/Models/Common/PagedResult.cs

19 lines
454 B
C#

namespace kehati.Models.Common;
using Microsoft.EntityFrameworkCore;
public class PagedResult<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 bool HasPrevious => CurrentPage > 1;
public bool HasNext => CurrentPage < TotalPages;
}