QueryDto
Namespace: MJCZone.DapperMatic.AspNetCore.Models.Dtos
Assembly: MJCZone.DapperMatic.AspNetCore
Summary
/// Request model for querying tables or views with filtering, sorting, and pagination.
public
Contents
Constructors (1) | Methods (8) | Properties (7)
Constructors
QueryDto
QueryDto()Methods
| Method | Summary |
|---|---|
| GetOrderByPairs | Parses the OrderBy string into a list of column and direction pairs. |
| GetFilterConditions | Parses the filter conditions into a structured format. |
| GetSelectColumns | Gets the columns to select as a list. |
| FromQueryParameters | Creates a QueryRequest from query string parameters. |
| GetType | |
| ToString | |
| Equals | |
| GetHashCode |
GetOrderByPairs
Parses the OrderBy string into a list of column and direction pairs.
List<(string, bool)> GetOrderByPairs()Returns
Type: List<(string, bool)>
A list of column and direction pairs.
GetFilterConditions
Parses the filter conditions into a structured format.
List<FilterConditionDto> GetFilterConditions()Returns
Type: List<FilterConditionDto>
A list of filter conditions.
GetSelectColumns
Gets the columns to select as a list.
List<string> GetSelectColumns()Returns
Type: List<string>
A list of column names to select.
FromQueryParameters
Creates a QueryRequest from query string parameters.
QueryDto FromQueryParameters(string query)Parameters
- query (string) - The query collection from HTTP request.
Returns
Type: QueryDto
A QueryRequest instance populated from query parameters.
GetType
GetType()ToString
ToString()Equals
Equals()GetHashCode
GetHashCode()Properties
Take
Gets or sets the number of records to take. Default is 100, max is 1000.
Type: int?
Skip
Gets or sets the number of records to skip for pagination.
Type: int?
IncludeTotal
Gets or sets a value indicating whether to include the total count in the response.
Type: bool?
OrderBy
Gets or sets the order by clause. Format: "column1.asc,column2.desc"
Type: string?
Filters
Gets or sets the filter conditions. Dictionary where key is "column.operator" and value is the filter value. Supported operators: eq, neq, gt, gte, lt, lte, like, nlike, in, nin, isnull, notnull
Type: Dictionary<string, string>
Select
Gets or sets the columns to select. If null or empty, selects all columns (*). Format: "column1,column2,column3"
Type: string?
SchemaName
Gets or sets the schema name. This is set internally from the route and not by the user.
Type: string?