TaxonomyDocumentQueryExtensionsInEnabledCategoriesTQuery, TObject Method |
Namespace: CMS.DocumentEngine
public static TQuery InEnabledCategories<TQuery, TObject>( this IDocumentQuery<TQuery, TObject> query, params string[] categoryNames ) where TQuery : Object, IDocumentQuery<TQuery, TObject> where TObject : new(), TreeNode
If the query is parameterized with OnSite(SiteInfoIdentifier, Boolean) method the DocumentQuery searches enabled site categories first. When no site categories are found it falls back on global categories search.
Note: This method is a data filter and can be used directly only to modify the DocumentQuery (e.g. DocumentHelper.GetDocuments().InEnabledCategories("Category_A")). It cannot be used as a part of where condition (e.g. DocumentHelper.GetDocuments().WhereContains("DocumentName", "Article").Or().InEnabledCategories("Category_A")).