Paged list for .NET applications
string originUrl = "http://www.myapp.com/list?filterA=xyz&filterB=123=123&pageSize=10&pageNumber=5";
int itemCount = 347;
int pageSize = 10;
int pageNumber = 5;
PagedList pagedList = new PagedList(originUrl, itemCount, pageNumber, pageSize);
{
"options" : {
"pageNumber" : 5,
"pageSize" : 10,
"itemCount" : 347,
"pageCount" : 35
},
"navigator" : {
"navigatorSize" : null,
"first" : {
"url" : "http://www.myapp.com/list?filterA=xyz&filterB=123=123&pageSize=10&pageNumber=1",
"number" : 1
},
"previous" : {
"url" : "http://www.myapp.com/list?filterA=xyz&filterB=123=123&pageSize=10&pageNumber=4",
"number" : 4
},
"next" : {
"url" : "http://www.myapp.com/list?filterA=xyz&filterB=123=123&pageSize=10&pageNumber=6",
"number" : 6
},
"last" : {
"url" : "http://www.myapp.com/list?filterA=xyz&filterB=123=123&pageSize=10&pageNumber=35",
"number" : 35
},
"numerics" : null
}
}
string originUrl = "http://www.myapp.com/list?filterA=xyz&filterB=123=123&pageSize=10&pageNumber=5";
int itemCount = 347;
int pageSize = 10;
int pageNumber = 5;
int navigatorSize = 10;
PagedList pagedList = new PagedList(originUrl, itemCount, pageNumber, pageSize, navigatorSize);
{
"options":{
"pageNumber":5,
"pageSize":10,
"itemCount":347,
"pageCount":35
},
"navigator":{
"navigatorSize":10,
"first":{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123=123&pageSize=10&pageNumber=1",
"number":1
},
"previous":{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123=123&pageSize=10&pageNumber=4",
"number":4
},
"next":{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123=123&pageSize=10&pageNumber=6",
"number":6
},
"last":{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=35",
"number":35
},
"numerics":[
{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=1",
"number":1
},
{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=2",
"number":2
},
{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=3",
"number":3
},
{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=4",
"number":4
},
{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=5",
"number":5
},
{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=6",
"number":6
},
{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=7",
"number":7
},
{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=8",
"number":8
},
{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=9",
"number":9
},
{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=10",
"number":10
}
]
}
}
For this examples, the numeric navigator is defined as 3.
{
"options":{
"pageNumber":1,
"pageSize":10,
"itemCount":347,
"pageCount":35
},
"navigator":{
"navigatorSize":3,
"first":null,
"previous":null,
"next":{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=2",
"number":2
},
"last":{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=35",
"number":35
},
"numerics":[
{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=1",
"number":1
},
{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=2",
"number":2
},
{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=3",
"number":3
}
]
}
}
{
"options":{
"pageNumber":35,
"pageSize":10,
"itemCount":347,
"pageCount":35
},
"navigator":{
"navigatorSize":3,
"first":{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=1",
"number":1
},
"previous":{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=34",
"number":34
},
"next":null,
"last":null,
"numerics":[
{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=33",
"number":33
},
{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=34",
"number":34
},
{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=35",
"number":35
}
]
}
}
{
"options":{
"pageNumber":1,
"pageSize":10,
"itemCount":10,
"pageCount":1
},
"navigator":{
"navigatorSize":3,
"first":null,
"previous":null,
"next":null,
"last":null,
"numerics":[
{
"url":"http://www.myapp.com/list?filterA=xyz&filterB=123&pageSize=10&pageNumber=1",
"number":1
}
]
}
}
{
"options":{
"pageNumber":1,
"pageSize":10,
"itemCount":0,
"pageCount":0
},
"navigator":{
"navigatorSize":3,
"first":null,
"previous":null,
"next":null,
"last":null,
"numerics":null
}
}
Please, refer to CONTRIBUTING
Open a new Issue following our issue template ISSUE-TEMPLATE
See in nuget version history
if you liked this project, please make a contribution and help to keep this and other initiatives, send me some Satochis.
BTC Wallet: 1G535x1rYdMo9CNdTGK3eG6XJddBHdaqfX