using Microsoft.AspNetCore.Mvc.ModelBinding;
namespace Events.WebAPI.Models;
///
/// Map lazy loading parameters (e.g. from PrimeNG table)
///
public class LoadParams
{
///
/// Page to load
///
public int Page { get; set; } = 1;
///
/// Number of elements to return
///
public int? PageSize { get; set; }
///
/// 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
///
public string? Sort { get; set; }
///
/// 1 ascending, -1 descending
///
public int? SortOrder { get; set; }
///
/// Sieve style filter string
///
public string? Filters { get; set; }
[BindNever] public bool Ascending => SortOrder == null || SortOrder != -1;
}