Table of Contents

Interface IDataQuerySettings<TQuery>

Namespace
CMS.DataEngine
Assembly
CMS.DataEngine.dll

Data query parameters interface for a specific query

public interface IDataQuerySettings<TQuery> : IWhereCondition<TQuery>, IQueryParameters<TQuery>, IDataQuerySettings, IWhereCondition, IQueryParameters, IQueryObject

Type Parameters

TQuery
Inherited Members
Extension Methods

Methods

AddColumn(IQueryColumn)

Adds the additional column to the query

TQuery AddColumn(IQueryColumn column)

Parameters

column IQueryColumn

Column to add

Returns

TQuery

AddColumn(string)

Adds the additional column to the query

TQuery AddColumn(string column)

Parameters

column string

Column to add

Returns

TQuery

AddColumns(params IQueryColumn[])

Adds the additional columns to the query

TQuery AddColumns(params IQueryColumn[] columns)

Parameters

columns IQueryColumn[]

Columns to add

Returns

TQuery

AddColumns(IEnumerable<string>)

Adds the additional columns to the query

TQuery AddColumns(IEnumerable<string> columns)

Parameters

columns IEnumerable<string>

Columns to add

Returns

TQuery

AddColumns(params string[])

Adds the additional columns to the query

TQuery AddColumns(params string[] columns)

Parameters

columns string[]

Columns to add

Returns

TQuery

Column(IQueryColumn)

Sets the column to select

TQuery Column(IQueryColumn column)

Parameters

column IQueryColumn

Column to set to be selected

Returns

TQuery

Column(string)

Sets the column to select

TQuery Column(string column)

Parameters

column string

Column to set to be selected

Returns

TQuery

Columns(params IQueryColumn[])

Sets the columns to select

TQuery Columns(params IQueryColumn[] columns)

Parameters

columns IQueryColumn[]

Columns to set to be selected

Returns

TQuery

Columns(IEnumerable<string>)

Sets the columns to select

TQuery Columns(IEnumerable<string> columns)

Parameters

columns IEnumerable<string>

Columns to set to be selected

Returns

TQuery

Columns(params string[])

Sets the columns to select

TQuery Columns(params string[] columns)

Parameters

columns string[]

Columns to set to be selected

Returns

TQuery

Distinct(bool)

Sets the query to use distinct selection over the given columns

TQuery Distinct(bool distinct = true)

Parameters

distinct bool

If set to true, returns only distinct (different) values.

Returns

TQuery

GroupBy(params string[])

Specifies the columns to group by

TQuery GroupBy(params string[] columns)

Parameters

columns string[]

List of columns to group by

Returns

TQuery

Having(params IWhereCondition[])

Adds the given having conditions to the query.

TQuery Having(params IWhereCondition[] conditions)

Parameters

conditions IWhereCondition[]

Having where conditions

Returns

TQuery

Having(Action<WhereCondition>)

Adds the given where condition to the query. Creates a new where condition object and runs the setup actions on it.

TQuery Having(Action<WhereCondition> condition)

Parameters

condition Action<WhereCondition>

Nested where condition

Returns

TQuery

Having(string, bool)

Specifies the group by having condition

TQuery Having(string having, bool replace = false)

Parameters

having string

Having condition

replace bool

If true, the having condition replaces the original having condition

Returns

TQuery

NewGroupBy(params string[])

Clears the current group by, reverting the source of data to the original. Note, that this method also resets the existing having condition which is closely bound to the group by.

[Obsolete("Method was not intended for public use and will be removed in the next version.")]
[ObsoleteSince(27, 0)]
TQuery NewGroupBy(params string[] columns)

Parameters

columns string[]

Returns

TQuery

NewHaving()

Clears the current having condition

[Obsolete("Method was not intended for public use and will be removed in the next version.")]
[ObsoleteSince(27, 0)]
TQuery NewHaving()

Returns

TQuery

NextPage()

Adjusts the query to a next page, using the current page size. Use in combination with PagedBy and NextPageAvailable to iterate over the data in batches.

TQuery NextPage()

Returns

TQuery

Remarks

Number of records in one page can be specified by setting MaxRecords property or calling PagedBy() method.

NotPaged()

Sets up the query to become not paged query and output all results at once.

TQuery NotPaged()

Returns

TQuery

OrderBy(OrderDirection, params string[])

Adds the columns to the order by query

TQuery OrderBy(OrderDirection dir, params string[] columns)

Parameters

dir OrderDirection

Order direction

columns string[]

Columns to add to order by

Returns

TQuery

OrderBy(params string[])

Adds the columns to the order by query

TQuery OrderBy(params string[] columns)

Parameters

columns string[]

Columns to add to order by

Returns

TQuery

OrderByAscending(params string[])

Adds the columns to the order by query to order by the given columns in ascending order

TQuery OrderByAscending(params string[] columns)

Parameters

columns string[]

Columns to add to order by

Returns

TQuery

OrderByDescending(params string[])

Adds the columns to the order by query to order by the given columns in descending order

TQuery OrderByDescending(params string[] columns)

Parameters

columns string[]

Columns to add to order by

Returns

TQuery

Page(int, int)

Specifies the page to select with given page index and page size. Page number is indexed from 0 (first page)

TQuery Page(int pageIndex, int pageSize)

Parameters

pageIndex int
pageSize int

Returns

TQuery

PagedBy(int)

Sets up the query as a paged query with the given page size. Resets the page index to first page. Use in combination with NextPageAvailable and NextPage to iterate over the data in batches.

TQuery PagedBy(int pageSize)

Parameters

pageSize int

Returns

TQuery

Remarks

Note that if you iterate the results after calling this method, the results will cover only a single page. To iterate through all items page-by-page, use methods ForEachRow or ForEachObject.

ReplaceColumn(string, string)

Replaces the selected column with a new name

TQuery ReplaceColumn(string originalName, string newName)

Parameters

originalName string

Original column name

newName string

New column name

Returns

TQuery

Take()

Identity method to make the query expression more readable. Use before the Columns or Page method. Doesn't provide any functionality.

TQuery Take()

Returns

TQuery

Then()

Identity method to make the query expression more readable. Use before the OrderBy method. Doesn't provide any functionality.

TQuery Then()

Returns

TQuery

TopN(int)

Selects only first top N number of records

TQuery TopN(int topN)

Parameters

topN int

Returns

TQuery