-
Notifications
You must be signed in to change notification settings - Fork 34
/
Pagination.cs
32 lines (28 loc) · 1 KB
/
Pagination.cs
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
using System.ComponentModel.DataAnnotations;
using Tzkt.Api.Services;
namespace Tzkt.Api
{
public class Pagination : INormalizable
{
/// <summary>
/// Sorts items (asc or desc) by the specified field.
/// You can see what fields can be used for sorting in the response description, below.
/// Click on the parameter to expand more details.
/// </summary>
public SortParameter sort { get; set; }
/// <summary>
/// Specifies which or how many items should be skipped.
/// Click on the parameter to expand more details.
/// </summary>
public OffsetParameter offset { get; set; }
/// <summary>
/// Maximum number of items to return.
/// </summary>
[Range(0, 10000)]
public int limit { get; set; } = 100;
public string Normalize(string name)
{
return ResponseCacheService.BuildKey("", ("sort", sort), ("offset", offset), ("limit", limit));
}
}
}