first commit
This commit is contained in:
19
MyNewProjectName.Contracts/Common/PaginationParams.cs
Normal file
19
MyNewProjectName.Contracts/Common/PaginationParams.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace MyNewProjectName.Contracts.Common
|
||||
{
|
||||
// Parameters for handling pagination in requests
|
||||
public class PaginationParams
|
||||
{
|
||||
private const int MaxPageSize = 1000;
|
||||
private int _pageSize = 50;
|
||||
|
||||
// Page number (default is 1)
|
||||
public int PageNumber { get; set; } = 1;
|
||||
|
||||
// Page size with validation to ensure it doesn't exceed MaxPageSize
|
||||
public int PageSize
|
||||
{
|
||||
get => _pageSize;
|
||||
set => _pageSize = (value > MaxPageSize) ? MaxPageSize : value;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user