This commit is contained in:
2020-01-13 22:20:46 +00:00
parent 40906ecabb
commit 45b1cba18b
7 changed files with 20 additions and 20 deletions

View File

@@ -0,0 +1,28 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Mvc;
namespace AyaNova.Api.ControllerHelpers
{
public sealed class ListOptions
{
public const int MaxPageSize = 1000;
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 1000.")]
public int? Limit { get; set; }
//Data filter id to use with this list query
//0 or less means no filter
public long DataFilterId { get; set; }
}
}