public PaginatedList(int pageIndex, int pageSize, int totalItemsCount, IEnumerable <T> data) { PaginationBase = new PaginationBase { PageIndex = pageIndex, PageSize = pageSize }; TotalItemsCount = totalItemsCount; AddRange(data); }
public string CreateResouceUrl(PaginationBase paremeters, PaginationResourceUriType uriType, string EntityName) { switch (uriType) { case PaginationResourceUriType.PreviousPage: var previousParameters = paremeters; previousParameters.PageIndex--; return(_urlHelper.Link(EntityName, previousParameters)); case PaginationResourceUriType.NextPage: var nextParameters = paremeters; nextParameters.PageIndex++; return(_urlHelper.Link(EntityName, nextParameters)); default: return(_urlHelper.Link(EntityName, paremeters)); } }