예제 #1
0
 public PaginatedList(int pageIndex, int pageSize, int totalItemsCount, IEnumerable <T> data)
 {
     PaginationBase = new PaginationBase
     {
         PageIndex = pageIndex,
         PageSize  = pageSize
     };
     TotalItemsCount = totalItemsCount;
     AddRange(data);
 }
예제 #2
0
        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));
            }
        }