daily pastebin goal
20%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public interface IPagedList<T> : IList<T>
  2. {
  3.     PagingInformation Paging { get; set; }
  4. }
  5.    
  6. public class PagedList<T> : List<T>, IPagedList<T> //, IList<T>
  7. {
  8.     public PagingInformation Paging { get; set; }
  9.  
  10.     public PagedList()
  11.     {
  12.     }
  13.  
  14.     public PagedList(IEnumerable<T> collection) : base(collection)
  15.     {
  16.     }
  17.  
  18.     public PagedList(IEnumerable<T> collection, PagingInformation paging) : base(collection)
  19.     {
  20.         Paging = paging;
  21.     }
  22.  
  23.     public PagedList(int capacity) : base(capacity)
  24.     {
  25.     }
  26.  
  27.     PagingInformation IPagedList<T>.Paging
  28.     {
  29.         get => Paging;
  30.         set => Paging = value;
  31.     }
  32.  
  33.     IEnumerator IEnumerable.GetEnumerator()
  34.     {
  35.         return GetEnumerator();
  36.     }
  37.  
  38.  
  39. }
  40.    
  41. public async Task<DomainResult<IPagedList<PositionDto>>> GetPagedListAsync(int pageIndex = 0, int pageSize = 20)
  42. {
  43.     return DomainResult<IPagedList<PositionDto>>.Success(_mapper.Map<IPagedList<PositionDto>>(await _positionRepository.GetPagedListAsync(pageIndex, pageSize)));
  44. }
RAW Paste Data
Top