diff options
author | crupest <crupest@outlook.com> | 2022-04-09 18:38:46 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-04-09 18:38:46 +0800 |
commit | 4db131899145b7aca0ea5fd36984cf1542c9619b (patch) | |
tree | e3b9729dfcc744a79f601b674ec6cecaf47dc9da /BackEnd/Timeline/Models/Page.cs | |
parent | bab2b1d568a7273b6800dbe6ffd31972d5cedd24 (diff) | |
download | timeline-4db131899145b7aca0ea5fd36984cf1542c9619b.tar.gz timeline-4db131899145b7aca0ea5fd36984cf1542c9619b.tar.bz2 timeline-4db131899145b7aca0ea5fd36984cf1542c9619b.zip |
...
Diffstat (limited to 'BackEnd/Timeline/Models/Page.cs')
-rw-r--r-- | BackEnd/Timeline/Models/Page.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/BackEnd/Timeline/Models/Page.cs b/BackEnd/Timeline/Models/Page.cs new file mode 100644 index 00000000..807702c1 --- /dev/null +++ b/BackEnd/Timeline/Models/Page.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; + +namespace Timeline.Models +{ + public class Page<T> + { + public Page() + { + } + + public Page(long pageNumber, long pageSize, long totalCount, List<T> items) + { + PageNumber = pageNumber; + PageSize = pageSize; + TotalPageCount = totalCount / PageSize + (totalCount % PageSize != 0 ? 1 : 0); + TotalCount = totalCount; + Items = items; + } + + public long PageNumber { get; set; } + public long PageSize { get; set; } + public long TotalPageCount { get; set; } + public long TotalCount { get; set; } + public List<T> Items { get; set; } = new List<T>(); + } +} + |