Class ContentQueryParametersBase<T>
- Namespace
- CMS.ContentEngine
- Assembly
- CMS.ContentEngine.dll
Provides parameterization options for content item queries.
public abstract class ContentQueryParametersBase<T> where T : ContentQueryParametersBase<T>
Type Parameters
T
- Inheritance
-
objectContentQueryParametersBase<T>
- Derived
- Extension Methods
Properties
ColumnAdded
Flag if columns were configured.
protected bool ColumnAdded { get; }
Property Value
- bool
Methods
Columns(params QueryColumn[])
Configures the columns to be selected.
public T Columns(params QueryColumn[] columns)
Parameters
columns
QueryColumn[]Columns to be selected represented as QueryColumn.
Returns
- T
Returns this
T
instance to chain further configuration.
- See Also
Columns(params string[])
Configures the columns to be selected.
public T Columns(params string[] columnNames)
Parameters
columnNames
string[]Names of columns to be selected.
Returns
- T
Returns this
T
instance to chain further configuration.
IncludeTotalCount()
Configures query to include total count of results when the query has Offset(int, int) configured.
public T IncludeTotalCount()
Returns
- T
Remarks
When querying multiple content item types, configure it for the outer query via Parameters(Action<ContentQueryParameters>).
Offset(int, int)
Configures the offset and number of records to be returned.
public T Offset(int offset, int fetch)
Parameters
offset
intIndex of the first record to return.
fetch
intNumber of records to return.
Returns
- T
Returns this
T
instance to chain further configuration.
Remarks
Requires configured ordering via OrderBy(params OrderByColumn[]) method - it guarantees consistently ordered results. When querying multiple content item types, configure the offset for the outer query via Parameters(Action<ContentQueryParameters>). Cannot be combined with TopN(int) in the same query expression (in the same query scope). Using Offset(int, int) is recommended to implement a query paging solution.
- See Also
OrderBy(params OrderByColumn[])
Configures one or multiple columns to perform order defined by arguments.
public T OrderBy(params OrderByColumn[] columns)
Parameters
columns
OrderByColumn[]Columns to perform order represented as OrderByColumn.
Returns
- T
Returns this
T
instance to chain further configuration.
Remarks
Must be combined with TopN(int) for an inner query if querying multiple content item types via ForContentType(string, Action<ContentTypeQueryParameters>).
OrderBy(params string[])
Configures one or multiple columns to perform ascending order.
public T OrderBy(params string[] columnNames)
Parameters
columnNames
string[]Names of columns to perform order.
Returns
- T
Returns this
T
instance to chain further configuration.
Remarks
Must be combined with TopN(int) for an inner query if querying multiple content item types via ForContentType(string, Action<ContentTypeQueryParameters>).
TopN(int)
Configures number of records to be returned.
public T TopN(int topN)
Parameters
topN
intNumber of records to return.
Returns
- T
Returns this
T
instance to chain further configuration.
Remarks
Cannot be combined with Offset(int, int) in the same query expression (in the same query scope). Use Offset(int, int) instead to implement a query paging solution.
Where(Action<WhereParameters>)
Configures query to extract only those records that fulfill a specified condition.
public T Where(Action<WhereParameters> configureWhere)
Parameters
configureWhere
Action<WhereParameters>Action configuring the where condition tree using the WhereParameters.
Returns
- T
Returns this
T
instance to chain further configuration.