PagedResultDto.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using System.Collections.Generic;
  3. namespace Abp.Application.Services.Dto
  4. {
  5. /// <summary>
  6. /// Implements <see cref="IPagedResult{T}"/>.
  7. /// </summary>
  8. /// <typeparam name="T">Type of the items in the <see cref="ListResultDto{T}.Items"/> list</typeparam>
  9. [Serializable]
  10. public class PagedResultDto<T> : ListResultDto<T>, IPagedResult<T>
  11. {
  12. /// <summary>
  13. /// Total count of Items.
  14. /// </summary>
  15. public int TotalCount { get; set; }
  16. /// <summary>
  17. /// Creates a new <see cref="PagedResultDto{T}"/> object.
  18. /// </summary>
  19. public PagedResultDto()
  20. {
  21. }
  22. /// <summary>
  23. /// Creates a new <see cref="PagedResultDto{T}"/> object.
  24. /// </summary>
  25. /// <param name="totalCount">Total count of Items</param>
  26. /// <param name="items">List of items in current page</param>
  27. public PagedResultDto(int totalCount, IReadOnlyList<T> items)
  28. : base(items)
  29. {
  30. TotalCount = totalCount;
  31. }
  32. }
  33. }