Search Results for

    Show / Hide Table of Contents
    View Source

    Class ApiPublishedContentCache

    Default implementation of IApiPublishedContentCache that provides access to published content for the Delivery API.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core.DeliveryApi
    Assembly: Umbraco.Core.dll
    Syntax
    public sealed class ApiPublishedContentCache : IApiPublishedContentCache

    Constructors

    View Source

    ApiPublishedContentCache(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 Source

    GetById(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 null if not found.

    View Source

    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 null if not found.

    View Source

    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.

    View Source

    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.

    View Source

    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 null if not found.

    View Source

    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 null if not found.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX