TaxonomyDocumentQueryExtensionsInCategoriesTQuery, TObject Method |
Namespace: CMS.DocumentEngine
public static TQuery InCategories<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 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().InCategories("Category_A")). It cannot be used as a part of where condition (e.g. DocumentHelper.GetDocuments().WhereContains("DocumentName", "Article").Or().InCategories("Category_A")).