| | 1 | | namespace Pozitron.QuerySpecification; |
| | 2 | |
|
| | 3 | | /// <summary> |
| | 4 | | /// Represents pagination settings. |
| | 5 | | /// </summary> |
| | 6 | | public record PaginationSettings |
| | 7 | | { |
| | 8 | | /// <summary> |
| | 9 | | /// Gets the default page number. |
| | 10 | | /// </summary> |
| 18 | 11 | | public int DefaultPage { get; } = 1; |
| | 12 | |
|
| | 13 | | /// <summary> |
| | 14 | | /// Gets the default page size. |
| | 15 | | /// </summary> |
| 20 | 16 | | public int DefaultPageSize { get; } = 10; |
| | 17 | |
|
| | 18 | | /// <summary> |
| | 19 | | /// Gets the default page size limit. |
| | 20 | | /// </summary> |
| 55 | 21 | | public int DefaultPageSizeLimit { get; } = 50; |
| | 22 | |
|
| | 23 | | /// <summary> |
| | 24 | | /// Gets the default pagination settings. |
| | 25 | | /// </summary> |
| 71 | 26 | | public static PaginationSettings Default { get; } = new(); |
| | 27 | |
|
| 4 | 28 | | private PaginationSettings() { } |
| | 29 | |
|
| | 30 | | /// <summary> |
| | 31 | | /// Initializes a new instance of the <see cref="PaginationSettings"/> class with the specified default page size an |
| | 32 | | /// </summary> |
| | 33 | | /// <param name="defaultPageSize">The default page size.</param> |
| | 34 | | /// <param name="defaultPageSizeLimit">The default page size limit.</param> |
| 5 | 35 | | public PaginationSettings(int defaultPageSize, int defaultPageSizeLimit) |
| | 36 | | { |
| 5 | 37 | | DefaultPageSize = defaultPageSize; |
| 5 | 38 | | DefaultPageSizeLimit = defaultPageSizeLimit; |
| 5 | 39 | | } |
| | 40 | | } |