blob: c0d8d47208812f13ffdfaf364206a0c17e844797 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
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>();
public Page<U> WithItems<U>(List<U> items)
{
return new Page<U>(PageNumber, PageSize, TotalCount, items);
}
}
}
|