Class PublishedContentQueryAccessor
Provides access to the IPublishedContentQuery service, enabling queries against published content within Umbraco. Typically used to retrieve or interact with published content data in a decoupled manner.
Inheritance
object
Namespace: Umbraco.Cms.Core
Assembly: Umbraco.Infrastructure.dll
Syntax
public class PublishedContentQueryAccessor : IPublishedContentQueryAccessor
Constructors
View SourcePublishedContentQueryAccessor(IScopedServiceProvider)
Initializes a new instance of the PublishedContentQueryAccessor class with the specified scoped service provider.
Declaration
public PublishedContentQueryAccessor(IScopedServiceProvider scopedServiceProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| IScopedServiceProvider | scopedServiceProvider | The IScopedServiceProvider used to resolve services within the current scope. |
Methods
View SourceTryGetValue(out IPublishedContentQuery)
Attempts to get the current IPublishedContentQuery instance.
Declaration
public bool TryGetValue(out IPublishedContentQuery publishedContentQuery)
Parameters
| Type | Name | Description |
|---|---|---|
| IPublishedContentQuery | publishedContentQuery | When this method returns, contains the IPublishedContentQuery instance if available; otherwise, null. |
Returns
| Type | Description |
|---|---|
| bool |
|