PagingDto.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using MTWorkHR.Core.IDto;
  2. namespace MTWorkHR.Application.Models
  3. {
  4. public class PagingResultDto<TEntity>: IPagingResultDto<TEntity> where TEntity : class
  5. {
  6. public int Total { get; set; }
  7. public IList<TEntity>? Result { get; set; }
  8. }
  9. public class PagingNotificationResultDto<TEntity> : IPagingResultDto<TEntity> where TEntity : class
  10. {
  11. public int Total { get; set; }
  12. public int TotalUnRead { get; set; }
  13. public IList<TEntity>? Result { get; set; }
  14. }
  15. public class PagingInputDto : IPagingInputDto
  16. {
  17. private int pageNumber;
  18. private int pageSize;
  19. private string? orderByField;
  20. private string? orderType;
  21. public int PageNumber { get => pageNumber ==0 ? 1 : pageNumber; set => pageNumber = value; }
  22. public int PageSize { get => pageSize==0?10: pageSize; set => pageSize = value; }
  23. public string? OrderByField { get => string.IsNullOrEmpty(orderByField)?"Id": orderByField; set => orderByField = value; }
  24. public string? OrderType { get => string.IsNullOrEmpty(orderType) ? "asc" : orderType; set => orderType = value; }
  25. public string? Filter { get; set; }
  26. public string HiddenFilter { get ; set; }
  27. }
  28. }