35 lines
920 B
C#
35 lines
920 B
C#
using Microsoft.AspNetCore.Mvc.ModelBinding;
|
|
|
|
namespace Events.WebAPI.Models;
|
|
|
|
/// <summary>
|
|
/// Map lazy loading parameters (e.g. from PrimeNG table)
|
|
/// </summary>
|
|
public class LoadParams
|
|
{
|
|
/// <summary>
|
|
/// Page to load
|
|
/// </summary>
|
|
public int Page { get; set; } = 1;
|
|
/// <summary>
|
|
/// Number of elements to return
|
|
/// </summary>
|
|
public int? PageSize { get; set; }
|
|
/// <summary>
|
|
/// Name of a column. Must be same as in corresponding DTO object, case insensitive
|
|
/// In case of multiple columns, separated them with comma and without spaces
|
|
/// </summary>
|
|
public string? Sort { get; set; }
|
|
/// <summary>
|
|
/// 1 ascending, -1 descending
|
|
/// </summary>
|
|
public int? SortOrder { get; set; }
|
|
|
|
/// <summary>
|
|
/// Sieve style filter string
|
|
/// </summary>
|
|
public string? Filters { get; set; }
|
|
|
|
[BindNever] public bool Ascending => SortOrder == null || SortOrder != -1;
|
|
}
|