public Paginator(IEnumerable <T> elements, int pageSize, string defaultValue = null) { _defaultValue = defaultValue; Elements = elements.ToList(); PageSize = pageSize; PageCount = Paginate.GetPageCount(Elements.Count, PageSize); }
public Page <T> PageAt(int index) { return(new Page <T>(Paginate.GetCollectionOffset(Elements.Count, PageSize, index), Paginate.GroupAt(Elements, index, PageSize), _defaultValue)); }