Class ApiPublishedContentCache
Default implementation of IApiPublishedContentCache that provides access to published content for the Delivery API.
Inheritance
Namespace: Umbraco.Cms.Core.DeliveryApi
Assembly: Umbraco.Core.dll
Syntax
public sealed class ApiPublishedContentCache : IApiPublishedContentCache
Constructors
View SourceApiPublishedContentCache(IRequestPreviewService, IOptionsMonitor<DeliveryApiSettings>, IApiDocumentUrlService, IPublishedContentCache, IVariationContextAccessor)
Initializes a new instance of the ApiPublishedContentCache class.
Declaration
public ApiPublishedContentCache(IRequestPreviewService requestPreviewService, IOptionsMonitor<DeliveryApiSettings> deliveryApiSettings, IApiDocumentUrlService apiDocumentUrlService, IPublishedContentCache publishedContentCache, IVariationContextAccessor variationContextAccessor)
Parameters
| Type | Name | Description |
|---|---|---|
| IRequestPreviewService | requestPreviewService | The request preview service. |
| IOptionsMonitor<DeliveryApiSettings> | deliveryApiSettings | The Delivery API settings. |
| IApiDocumentUrlService | apiDocumentUrlService | The API document URL service. |
| IPublishedContentCache | publishedContentCache | The published content cache. |
| IVariationContextAccessor | variationContextAccessor | The variation context accessor. |
Methods
View SourceGetById(Guid)
Gets published content by its unique identifier.
Declaration
public IPublishedContent? GetById(Guid contentId)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | contentId | The content's unique identifier. |
Returns
| Type | Description |
|---|---|
| IPublishedContent | The published content, or |
GetByIdAsync(Guid)
Asynchronously gets published content by its unique identifier.
Declaration
public Task<IPublishedContent?> GetByIdAsync(Guid contentId)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | contentId | The content's unique identifier. |
Returns
| Type | Description |
|---|---|
| Task<IPublishedContent> | A task containing the published content, or |
GetByIds(IEnumerable<Guid>)
Gets multiple published content items by their unique identifiers.
Declaration
public IEnumerable<IPublishedContent> GetByIds(IEnumerable<Guid> contentIds)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<Guid> | contentIds | The content unique identifiers. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IPublishedContent> | The published content items that were found. |
GetByIdsAsync(IEnumerable<Guid>)
Asynchronously gets multiple published content items by their unique identifiers.
Declaration
public Task<IEnumerable<IPublishedContent>> GetByIdsAsync(IEnumerable<Guid> contentIds)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<Guid> | contentIds | The content unique identifiers. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<IPublishedContent>> | A task containing the published content items that were found. |
GetByRoute(string)
Gets published content by its route.
Declaration
public IPublishedContent? GetByRoute(string route)
Parameters
| Type | Name | Description |
|---|---|---|
| string | route | The content route. |
Returns
| Type | Description |
|---|---|
| IPublishedContent | The published content, or |
GetByRouteAsync(string)
Asynchronously gets published content by its route.
Declaration
public Task<IPublishedContent?> GetByRouteAsync(string route)
Parameters
| Type | Name | Description |
|---|---|---|
| string | route | The content route. |
Returns
| Type | Description |
|---|---|
| Task<IPublishedContent> | A task containing the published content, or |