| | | 1 | | namespace ArturRios.Mediator.Query; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Base type for all queries. A query represents a read-only request for data and is |
| | | 5 | | /// dispatched through the <see cref="QueryMediator"/> to its corresponding handler. |
| | | 6 | | /// </summary> |
| | | 7 | | /// <remarks> |
| | | 8 | | /// Derive from this type to define a query, exposing any filter criteria as properties. |
| | | 9 | | /// The <see cref="PageNumber"/> and <see cref="PageSize"/> properties are used by |
| | | 10 | | /// paginated query handlers and ignored by non-paginated ones. |
| | | 11 | | /// </remarks> |
| | | 12 | | public abstract class BaseQuery |
| | | 13 | | { |
| | | 14 | | /// <summary> |
| | | 15 | | /// The 1-based page number to retrieve when the query is executed as a paginated query. |
| | | 16 | | /// Defaults to <c>1</c>. |
| | | 17 | | /// </summary> |
| | 16 | 18 | | public int PageNumber { get; set; } = 1; |
| | | 19 | | |
| | | 20 | | /// <summary> |
| | | 21 | | /// The maximum number of items per page when the query is executed as a paginated query. |
| | | 22 | | /// Defaults to <c>100</c>. |
| | | 23 | | /// </summary> |
| | 10 | 24 | | public int PageSize { get; set; } = 100; |
| | | 25 | | } |