12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Common.Models
- {
- public class PaginationQuery
- {
-
-
-
- public int Rows { get; set; }
-
-
-
- public int Page { get; set; }
-
-
-
- public string Sidx { get; set; }
-
-
-
- public string Sord { get; set; } = "DESC";
- }
- public class PaginationDTO<T>: PaginationQuery
- {
-
-
-
- public T Data { get; set; }
-
-
-
- public int Total { get; set; }
-
-
-
- public int Pages
- {
- get
- {
- if (Total > 0)
- {
- return Total % this.Rows == 0 ? Total / this.Rows : Total / this.Rows + 1;
- }
- else
- {
- return 0;
- }
- }
- }
- }
- }
|