Search Results for

    Show / Hide Table of Contents
    View Source

    Class UmbracoContextAccessorExtensions

    Provides extension methods for IUmbracoContextAccessor.

    Inheritance
    object
    Namespace: Umbraco.Extensions
    Assembly: Umbraco.Core.dll
    Syntax
    public static class UmbracoContextAccessorExtensions

    Methods

    View Source

    GetRequiredUmbracoContext(IUmbracoContextAccessor)

    Gets the Umbraco context, throwing an exception if it is not available.

    Declaration
    public static IUmbracoContext GetRequiredUmbracoContext(this IUmbracoContextAccessor umbracoContextAccessor)
    Parameters
    Type Name Description
    IUmbracoContextAccessor umbracoContextAccessor

    The Umbraco context accessor.

    Returns
    Type Description
    IUmbracoContext

    The current Umbraco context.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when the accessor is null.

    InvalidOperationException

    Thrown when the Umbraco context is not available.

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