You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class PaginatedResult<T>
{
public PaginatedResult(List<T> res, int totalCount, int pageSize, int currentPage)
{
Items = res;
TotalCount = totalCount;
var remainder = 0;
var pageCount = pageSize == 0 ? 0 : Math.DivRem(totalCount, pageSize, out remainder);
if (remainder > 0 || pageCount == 0)
++pageCount;
PageCount = pageCount;
CurrentPage = currentPage;
From = currentPage == 1 ? 1 : pageSize * (currentPage - 1);
To = currentPage == 1 ? res.Count : From + res.Count;
}
public int CurrentPage { get; set; }
public List<T> Items { get; set; }
public int TotalCount { get; set; }
public int PageCount { get; set; }
public int From { get; set; }
public int To { get; set; }
}
Activity