This commit is contained in:
23
server/AyaNova/ControllerHelpers/PagingOptions.cs
Normal file
23
server/AyaNova/ControllerHelpers/PagingOptions.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace AyaNova.Api.ControllerHelpers
|
||||
{
|
||||
|
||||
public sealed class PagingOptions
|
||||
{
|
||||
public const int MaxPageSize = 100;
|
||||
public const int DefaultOffset = 0;
|
||||
public const int DefaultLimit = 25;
|
||||
|
||||
[FromQuery]
|
||||
[Range(0, int.MaxValue)]
|
||||
public int? Offset { get; set; }
|
||||
|
||||
[FromQuery]
|
||||
[Range(1, MaxPageSize, ErrorMessage = "Limit must be greater than 0 and less than 100.")]
|
||||
public int? Limit { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user