Class ContentTypeQueryParameters
- Namespace
- CMS.ContentEngine
- Assembly
- CMS.ContentEngine.dll
Provides parameterization options for content item queries.
public sealed class ContentTypeQueryParameters : ContentQueryParametersBase<ContentTypeQueryParameters>
- Inheritance
-
objectContentTypeQueryParameters
- Inherited Members
- Extension Methods
Methods
LinkedFrom(string, string, IEnumerable<IContentItemIdentifier>)
Retrieves content items of the specified contentType linked from referenceFieldName.
public ContentTypeQueryParameters LinkedFrom(string contentType, string referenceFieldName, IEnumerable<IContentItemIdentifier> items)
Parameters
contentTypestringContent type name referencing content items to be retrieved.
referenceFieldNamestringName of the field within
contentTypereferencing content items to be retrieved.itemsIEnumerable<IContentItemIdentifier>Collection of IContentItemIdentifier of items for which to retrieve the linked items.
Returns
Remarks
Can be used together with WithLinkedItems(int) to retrieve further links. Simultaneous call with Linking(string, IEnumerable<int>) is not supported.
Exceptions
- ArgumentException
Thrown when
contentTypeorreferenceFieldNameis null or empty.- ArgumentException
Thrown when
contentTypedoes not exist.- ArgumentNullException
Thrown when
itemsis null.- InvalidOperationException
Thrown when field does not exist or it's datatype is not ContentItemReference.
LinkedFromSchemaField(string, IEnumerable<IContentItemIdentifier>)
Retrieves content items linked from referenceSchemaFieldName.
public ContentTypeQueryParameters LinkedFromSchemaField(string referenceSchemaFieldName, IEnumerable<IContentItemIdentifier> items)
Parameters
referenceSchemaFieldNamestringName of the schema field referencing content items to be retrieved.
itemsIEnumerable<IContentItemIdentifier>Collection of IContentItemIdentifier of items for which to retrieve the linked items.
Returns
Remarks
Can be used together with WithLinkedItems(int) to retrieve further links. Simultaneous call with Linking(string, IEnumerable<int>) is not supported.
Exceptions
- ArgumentException
Thrown when or
referenceSchemaFieldNameis null or empty.- ArgumentNullException
Thrown when
itemsis null.- InvalidOperationException
Thrown when schema field does not exist or it is not a reusable schema field or it's datatype is not ContentItemReference.
- See Also
Linking(string, IEnumerable<int>)
Configure query to retrieve linked items which reference any of items in the referenceFieldName.
public ContentTypeQueryParameters Linking(string referenceFieldName, IEnumerable<int> items)
Parameters
referenceFieldNamestringField name of the retrieved content item which includes the
items.itemsIEnumerable<int>Identifiers of items which are linked from the retrieved items.
Returns
- ContentTypeQueryParameters
Returns this ContentTypeQueryParameters instance to chain further configuration.
Remarks
Can be used together with WithLinkedItems(int) to retrieve further links. Simultaneous call with LinkedFrom(string, string, IEnumerable<IContentItemIdentifier>) is not supported.
Exceptions
- ArgumentException
Thrown when
referenceFieldNameis null or empty.- ArgumentNullException
Thrown when
itemsis null.
WithLinkedItems(int)
Configures query to include linked content items recursively up to the specified maxLevel.
public ContentTypeQueryParameters WithLinkedItems(int maxLevel)
Parameters
maxLevelintMaximal level of the linked items to include.
Returns
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.
Depending on the content model structure, including items to great depth can negatively affect querying performance.
WithLinkedItems(int, Action<LinkedItemsOptions>)
Configures query to include linked content items recursively up to the specified maxLevel.
public ContentTypeQueryParameters WithLinkedItems(int maxLevel, Action<LinkedItemsOptions> configureOptionsAction)
Parameters
maxLevelintMaximal level of the linked items to include.
configureOptionsActionAction<LinkedItemsOptions>Action to configure specific options for linked items. See LinkedItemsOptions for possible options.
Returns
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.
Depending on the content model structure, including items to great depth can negatively affect querying performance.