Skip to content

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

csharp
QueryDto()

Methods

MethodSummary
GetOrderByPairsParses the OrderBy string into a list of column and direction pairs.
GetFilterConditionsParses the filter conditions into a structured format.
GetSelectColumnsGets the columns to select as a list.
FromQueryParametersCreates a QueryRequest from query string parameters.
GetType
ToString
Equals
GetHashCode

GetOrderByPairs

Parses the OrderBy string into a list of column and direction pairs.

csharp
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.

csharp
List<FilterConditionDto> GetFilterConditions()

Returns

Type: List<FilterConditionDto>

A list of filter conditions.

GetSelectColumns

Gets the columns to select as a list.

csharp
List&lt;string&gt; GetSelectColumns()

Returns

Type: List&lt;string&gt;

A list of column names to select.

FromQueryParameters

Creates a QueryRequest from query string parameters.

csharp
QueryDto FromQueryParameters(string query)

Parameters

  • query (string) - The query collection from HTTP request.

Returns

Type: QueryDto

A QueryRequest instance populated from query parameters.

GetType

csharp
GetType()

ToString

csharp
ToString()

Equals

csharp
Equals()

GetHashCode

csharp
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&lt;string, string&gt;

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?