Class RetrieveMultipleQueryParametersBase<T>
Base parameters for retrieving content of multiple content types with fluent API for configuring the underlying query. IContentRetriever
public abstract class RetrieveMultipleQueryParametersBase<T> where T : RetrieveMultipleQueryParametersBase<T>
Type Parameters
T
- Inheritance
-
objectRetrieveMultipleQueryParametersBase<T>
- Derived
- Extension Methods
Properties
ContentQueryActions
Content query actions to be applied to the query parameters.
protected List<Action<ContentQueryParameters>> ContentQueryActions { get; init; }
Property Value
- List<Action<ContentQueryParameters>>
ContentTypesQueryActions
Content type query actions to be applied to the query parameters.
protected List<Action<ContentTypesQueryParameters>> ContentTypesQueryActions { get; init; }
Property Value
- List<Action<ContentTypesQueryParameters>>
Default
Returns default empty configuration action of T
.
public static Action<T> Default { get; }
Property Value
- Action<T>
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
T
instance to chain further configuration.
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
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
Returns
T
instance to chain further configuration.
LinkedFrom(string, string, IEnumerable<IContentItemIdentifier>)
Retrieves content items of the specified contentTypeName
linked from referenceFieldName
.
public T LinkedFrom(string contentTypeName, string referenceFieldName, IEnumerable<IContentItemIdentifier> items)
Parameters
contentTypeName
stringContent type name referencing content items to be retrieved.
referenceFieldName
stringName of the field within
contentTypeName
referencing content items to be retrieved.items
IEnumerable<IContentItemIdentifier>Collection of IContentItemIdentifier of items for which to retrieve the linked items.
Returns
- T
Returns this
T
instance to chain further configuration.
Remarks
Simultaneous call with Linking(string, string, IEnumerable<int>) or LinkingSchemaField(string, IEnumerable<int>) is not supported. Multiple calls of this method are not supported.
LinkedFromSchemaField(string, IEnumerable<IContentItemIdentifier>)
Retrieves content items linked from referenceSchemaFieldName
.
public T LinkedFromSchemaField(string referenceSchemaFieldName, IEnumerable<IContentItemIdentifier> items)
Parameters
referenceSchemaFieldName
stringName 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 this
T
instance to chain further configuration.
Remarks
Simultaneous call with Linking(string, string, IEnumerable<int>) or LinkingSchemaField(string, IEnumerable<int>) is not supported. Multiple calls of this method are not supported.
Linking(string, string, IEnumerable<int>)
Configure query to retrieve linked items which reference any of items
in the referenceFieldName
.
public T Linking(string contentTypeName, string referenceFieldName, IEnumerable<int> items)
Parameters
contentTypeName
stringThe name of the content type in which to search for the linking references via
referenceFieldName
.referenceFieldName
stringField 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
Simultaneous call with LinkedFrom(string, string, IEnumerable<IContentItemIdentifier>) or LinkedFromSchemaField(string, IEnumerable<IContentItemIdentifier>) is not supported. Multiple calls of this method are not supported.
LinkingSchemaField(string, IEnumerable<int>)
Configure query to retrieve linked items which reference in the referenceSchemaFieldName
.
public T LinkingSchemaField(string referenceSchemaFieldName, IEnumerable<int> items)
Parameters
referenceSchemaFieldName
stringName of the schema field referencing content items to be retrieved.
items
IEnumerable<int>Identifiers of items which are linked from the retrieved items.
Returns
- T
Returns this
T
instance to chain further configuration.
Remarks
Simultaneous call with LinkedFrom(string, string, IEnumerable<IContentItemIdentifier>) or LinkedFromSchemaField(string, IEnumerable<IContentItemIdentifier>) is not supported. Multiple calls of this method are not supported.
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
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.
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.
SetUrlLanguageBehavior(UrlLanguageBehavior)
Defines the behavior for URL paths of web pages in fallback languages.
public T SetUrlLanguageBehavior(UrlLanguageBehavior urlLanguageBehavior)
Parameters
urlLanguageBehavior
UrlLanguageBehaviorURL language behavior.
Returns
- T
Returns RetrieveAllPagesQueryParameters instance to chain further configuration.
Remarks
By default behavior is set to UseRequestedLanguage in Kentico.Content.Web.Mvc.ContentRetriever
TopN(int)
Configures number of records to be returned.
public T TopN(int topN)
Parameters
topN
intNumber 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.
WithLinkedItems(Action<LinkedItemsOptions>)
Configures query to include linked content items recursively up to the specified LinkedItemsMaxLevel.
public T WithLinkedItems(Action<LinkedItemsOptions> configureOptionsAction)
Parameters
configureOptionsAction
Action<LinkedItemsOptions>Action to configure specific options for linked items. See LinkedItemsOptions for possible options.
Returns
- T
Returns this
T
instance to chain further configuration.
Remarks
Use the GetLinkedItems(string) method during result mapping (GetResult<TModel>(ContentItemQueryBuilder, Func<IContentQueryDataContainer, TModel>, ContentQueryExecutionOptions, CancellationToken) to access the linked content items of an item.
By default Kentico.Content.Web.Mvc.ContentRetriever includes web page data for linked items. IncludeWebPageData(bool)