我有一个界面IPager
public interface IPager
{
int RecordCount { get; }
int PageNumber { get; }
int PageSize { get; }
}
public static class PagerExtensions
{
public static int GetPageCount(this IPager pager)
{
var totalPages = pager.RecordCount / pager.PageSize;
if (pager.RecordCount % pager.PageSize > 0)
totalPages += 1;
return totalPages;
}
}
GetTotalPages
听起来比 更传统吗GetPageCount
?