aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Models/Page.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-04-09 18:38:46 +0800
committercrupest <crupest@outlook.com>2022-04-09 18:38:46 +0800
commit4db131899145b7aca0ea5fd36984cf1542c9619b (patch)
treee3b9729dfcc744a79f601b674ec6cecaf47dc9da /BackEnd/Timeline/Models/Page.cs
parentbab2b1d568a7273b6800dbe6ffd31972d5cedd24 (diff)
downloadtimeline-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.cs28
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>();
+ }
+}
+