Table of Contents

Class RetrieveSingleQueryParametersBase<T>

Namespace
Kentico.Content.Web.Mvc
Assembly
Kentico.Content.Web.Mvc.dll

Base parameters for retrieving content of single content type with fluent API for configuring of the underlying query. IContentRetriever

public abstract class RetrieveSingleQueryParametersBase<T> : RetrieveQueryParametersBase<T> where T : RetrieveSingleQueryParametersBase<T>

Type Parameters

T
Inheritance
object
RetrieveSingleQueryParametersBase<T>
Derived
Inherited Members
Extension Methods

Methods

IncludeTotalCount()

Configures query to include total count of results when the query has Offset(int, int) configured.

public T IncludeTotalCount()

Returns

T

Returns T instance to chain further configuration.

LinkedFrom(string, string, IEnumerable<IContentItemIdentifier>)

Configures query to retrieve content items linked from referenceFieldName of the specified items of type contentType.

public T LinkedFrom(string contentType, string referenceFieldName, IEnumerable<IContentItemIdentifier> items)

Parameters

contentType string

Name of the content type referencing content items to be retrieved.

referenceFieldName string

Name of the field within contentType referencing content items to be retrieved.

items IEnumerable<IContentItemIdentifier>

Collection of IContentItemIdentifier of items for which to retrieve the linked items.

Returns

T

Returns T instance to chain further configuration.

Remarks

Can be used together with WithLinkedItems(Action<LinkedItemsOptions>) to retrieve further links. Simultaneous call with Linking(string, IEnumerable<int>) is not supported.

LinkedFromSchemaField(string, IEnumerable<IContentItemIdentifier>)

Retrieves content items linked from referenceSchemaFieldName.

public T LinkedFromSchemaField(string referenceSchemaFieldName, IEnumerable<IContentItemIdentifier> items)

Parameters

referenceSchemaFieldName string

Name of the schema field referencing content items to be retrieved.

items IEnumerable<IContentItemIdentifier>

Collection of IContentItemIdentifier of items for which to retrieve the linked items.

Returns

T

Returns T instance to chain further configuration.

Remarks

Can be used together with WithLinkedItems(Action<LinkedItemsOptions>) to retrieve further links. Simultaneous call with Linking(string, IEnumerable<int>) is not supported.

See Also

Linking(string, IEnumerable<int>)

Configure query to retrieve linked items which reference any of items in the referenceFieldName.

public T Linking(string referenceFieldName, IEnumerable<int> items)

Parameters

referenceFieldName string

Field name of the retrieved content item which includes the items.

items IEnumerable<int>

Identifiers of items which are linked from the retrieved items.

Returns

T

Returns this T instance to chain further configuration.

Remarks

Can be used together with WithLinkedItems(Action<LinkedItemsOptions>) to retrieve further links. Simultaneous call with LinkedFrom(string, string, IEnumerable<IContentItemIdentifier>) is not supported.

Offset(int, int)

Configures the offset and number of records to be returned.

public T Offset(int offset, int fetch)

Parameters

offset int

Index of the first record to return.

fetch int

Number of records to return.

Returns

T

Returns T instance to chain further configuration.

Remarks

Requires configured ordering via OrderBy(params OrderByColumn[]) method - it guarantees consistently ordered results. Cannot be combined with TopN(int). 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 T instance to chain further configuration.

See Also
Asc(string)
Desc(string)

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 T instance to chain further configuration.

TopN(int)

Configures number of records to be returned.

public T TopN(int topN)

Parameters

topN int

Number of records to return.

Returns

T

Returns T instance to chain further configuration.

Remarks

Cannot be combined with Offset(int, int). 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 T instance to chain further configuration.