PaginationDsM.cs
1019 Bytes
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
34
35
36
37
38
namespace MapsModels.DsModels
{
public class PaginationDsM
{
public const string ASC = "ASC";
public const string DESC = "DESC";
public int from { get; set; }
public int per_page;
public string sort { get; set; }
public string filter {get; set;}
public int perPage{
get{
if(per_page == 0){
return 25;
}
return per_page;
}
set{
per_page = value;
}
}
public string orderType(){
string orderType = null;
if(sort != null){
if(sort.StartsWith("-")){
sort = sort.Substring(1);
orderType = DESC;
} else {
orderType = ASC;
}
sort = char.ToUpper(sort[0]) + sort.Substring(1);
}
return orderType;
}
}
}