-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPagingParameter.cs
More file actions
21 lines (19 loc) · 820 Bytes
/
PagingParameter.cs
File metadata and controls
21 lines (19 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
namespace TalentManagementAPI.Application.Parameters
{
// Defines a class for paging parameters that can be used to control how data is paginated.
public class PagingParameter
{
// Maximum page size allowed (set to 200).
private const int maxPageSize = 200;
// Gets or sets the current page number, defaulting to 1 if not provided.
public int PageNumber { get; set; } = 1;
// Gets or sets the current page size. If a value greater than the maximum page size is provided,
// it will be limited to the maximum page size instead of throwing an error.
private int _pageSize = 10;
public int PageSize
{
get { return _pageSize; }
set { _pageSize = (value > maxPageSize) ? maxPageSize : value; }
}
}
}