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 SourceClear()
Clears the current IUmbracoContext.
Declaration
void Clear()
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. |
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, |
Returns
| Type | Description |
|---|---|
| bool |
|