Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface IPagedList<T> : IList<T>
- {
- PagingInformation Paging { get; set; }
- }
- public class PagedList<T> : List<T>, IPagedList<T> //, IList<T>
- {
- public PagingInformation Paging { get; set; }
- public PagedList()
- {
- }
- public PagedList(IEnumerable<T> collection) : base(collection)
- {
- }
- public PagedList(IEnumerable<T> collection, PagingInformation paging) : base(collection)
- {
- Paging = paging;
- }
- public PagedList(int capacity) : base(capacity)
- {
- }
- PagingInformation IPagedList<T>.Paging
- {
- get => Paging;
- set => Paging = value;
- }
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
- }
- public async Task<DomainResult<IPagedList<PositionDto>>> GetPagedListAsync(int pageIndex = 0, int pageSize = 20)
- {
- return DomainResult<IPagedList<PositionDto>>.Success(_mapper.Map<IPagedList<PositionDto>>(await _positionRepository.GetPagedListAsync(pageIndex, pageSize)));
- }
Add Comment
Please, Sign In to add comment