Search Results for

    Show / Hide Table of Contents
    View Source

    Class PublishedCacheBase

    Provides a base implementation for published content caches.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core.PublishedCache
    Assembly: Umbraco.Core.dll
    Syntax
    public abstract class PublishedCacheBase : IPublishedCache

    Constructors

    View Source

    PublishedCacheBase(IVariationContextAccessor, bool)

    Initializes a new instance of the PublishedCacheBase class.

    Declaration
    public PublishedCacheBase(IVariationContextAccessor variationContextAccessor, bool previewDefault)
    Parameters
    Type Name Description
    IVariationContextAccessor variationContextAccessor

    The variation context accessor for culture and segment information.

    bool previewDefault

    A value indicating whether preview mode is enabled by default.

    Properties

    View Source

    PreviewDefault

    Gets a value indicating whether preview mode is enabled by default.

    Declaration
    public bool PreviewDefault { get; }
    Property Value
    Type Description
    bool

    Methods

    View Source

    GetAtRoot(bool, string?)

    Gets content items at the root of the content tree.

    Declaration
    public abstract IEnumerable<IPublishedContent> GetAtRoot(bool preview, string? culture = null)
    Parameters
    Type Name Description
    bool preview

    A value indicating whether to consider unpublished content.

    string culture

    The optional culture to filter by.

    Returns
    Type Description
    IEnumerable<IPublishedContent>

    A collection of published content items at the root level.

    View Source

    GetById(bool, Guid)

    Gets a content identified by its unique identifier.

    Declaration
    public abstract IPublishedContent? GetById(bool preview, Guid contentId)
    Parameters
    Type Name Description
    bool preview

    A value indicating whether to consider unpublished content.

    Guid contentId

    The content unique identifier.

    Returns
    Type Description
    IPublishedContent

    The content, or null.

    Remarks

    The value of preview overrides defaults.

    View Source

    GetById(bool, int)

    Gets a content identified by its unique identifier.

    Declaration
    public abstract IPublishedContent? GetById(bool preview, int contentId)
    Parameters
    Type Name Description
    bool preview

    A value indicating whether to consider unpublished content.

    int contentId

    The content unique identifier.

    Returns
    Type Description
    IPublishedContent

    The content, or null.

    Remarks

    The value of preview overrides defaults.

    View Source

    GetById(Guid)

    Gets a content identified by its unique identifier.

    Declaration
    public IPublishedContent? GetById(Guid contentId)
    Parameters
    Type Name Description
    Guid contentId

    The content unique identifier.

    Returns
    Type Description
    IPublishedContent

    The content, or null.

    Remarks

    Considers published or unpublished content depending on defaults.

    View Source

    GetById(int)

    Gets a content identified by its unique identifier.

    Declaration
    public IPublishedContent? GetById(int contentId)
    Parameters
    Type Name Description
    int contentId

    The content unique identifier.

    Returns
    Type Description
    IPublishedContent

    The content, or null.

    Remarks

    Considers published or unpublished content depending on defaults.

    View Source

    HasById(bool, int)

    Determines whether content with the specified identifier exists.

    Declaration
    public abstract bool HasById(bool preview, int contentId)
    Parameters
    Type Name Description
    bool preview

    A value indicating whether to consider unpublished content.

    int contentId

    The content unique identifier.

    Returns
    Type Description
    bool

    true if content with the specified identifier exists; otherwise, false.

    View Source

    HasById(int)

    Determines whether content with the specified identifier exists using the default preview setting.

    Declaration
    public bool HasById(int contentId)
    Parameters
    Type Name Description
    int contentId

    The content unique identifier.

    Returns
    Type Description
    bool

    true if content with the specified identifier exists; otherwise, false.

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