Search Results for

    Show / Hide Table of Contents
    View Source

    Interface IUmbracoContextAccessor

    Provides access to the current IUmbracoContext.

    Namespace: Umbraco.Cms.Core.Web
    Assembly: Umbraco.Core.dll
    Syntax
    public interface IUmbracoContextAccessor
    Remarks

    Provides a TryGetUmbracoContext(out IUmbracoContext) method that returns true if the current IUmbracoContext is not null.

    Provides a Clear() method that will clear the current IUmbracoContext object.

    Provides a Set(IUmbracoContext) method that will set the current IUmbracoContext object.

    Methods

    View Source

    Clear()

    Clears the current IUmbracoContext.

    Declaration
    void Clear()
    View Source

    Set(IUmbracoContext)

    Sets the current IUmbracoContext.

    Declaration
    void Set(IUmbracoContext umbracoContext)
    Parameters
    Type Name Description
    IUmbracoContext umbracoContext

    The IUmbracoContext to set as the current context.

    View Source

    TryGetUmbracoContext(out IUmbracoContext)

    Tries to get the current IUmbracoContext.

    Declaration
    bool TryGetUmbracoContext(out IUmbracoContext umbracoContext)
    Parameters
    Type Name Description
    IUmbracoContext umbracoContext

    When this method returns, contains the current IUmbracoContext if available; otherwise, null.

    Returns
    Type Description
    bool

    true if the current IUmbracoContext is available; otherwise, false.

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