public PagedCollection(IPagedSelector <T> ps, int pageIndex) { this._list = ps.GetCurrentPage(pageIndex); this._pageIndex = pageIndex; this._pageSize = ps.PageSize; this._maxSize = ps.GetResultCount(); }
public static ItemList <T> GetItemList <T>(this IPagedSelector <T> selector, long pageIndex) where T : class, IDbObject, new() { var result = new ItemList <T> { List = selector.GetCurrentPage(pageIndex), Count = selector.GetResultCount(), PageSize = selector.PageSize, PageCount = selector.GetPageCount(), PageIndex = pageIndex + 1 }; return(result); }