42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
namespace Butter.Dtos;
|
|
|
|
/// <summary>
|
|
/// Represents pagination parameters for a query.
|
|
/// </summary>
|
|
public class PagedParametersDto {
|
|
|
|
/// <summary>
|
|
/// Contains the global constant for max pages.
|
|
/// </summary>
|
|
public const int MaxPageSize = 250;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the page number (zero-based).
|
|
/// </summary>
|
|
public int Page { get; set; } = 0;
|
|
/// <summary>
|
|
/// Gets or sets the number of items per page.
|
|
/// </summary>
|
|
public int PageSize { get; set; } = 150;
|
|
/// <summary>
|
|
/// Gets or sets the field to sort by (e.g. "name", "created").
|
|
/// When <c>null</c>, the default sort order is applied.
|
|
/// </summary>
|
|
public string? SortBy { get; set; }
|
|
/// <summary>
|
|
/// Gets or sets the sort direction.
|
|
/// <c>false</c> = descending (default), <c>true</c> = ascending.
|
|
/// </summary>
|
|
public bool SortAsc { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Represents pagination parameters with an optional search term.
|
|
/// </summary>
|
|
public class PagedSearchParametersDto: PagedParametersDto {
|
|
/// <summary>
|
|
/// Gets or sets the search term to filter results.
|
|
/// </summary>
|
|
public string? Search { get; set; } = string.Empty;
|
|
}
|