Class UmbracoContextReference
Represents a reference to an UmbracoContext instance.
Inheritance
System.Object
Namespace: Umbraco.Cms.Core
Assembly: Umbraco.Core.dll
Syntax
public class UmbracoContextReference : IDisposable
Remarks
A reference points to an UmbracoContext and it may own it (when it is a root reference) or just reference it. A reference must be disposed after it has been used. Disposing does nothing if the reference is not a root reference. Otherwise, it disposes the UmbracoContext and clears the IUmbracoContextAccessor.
Constructors
View SourceUmbracoContextReference(IUmbracoContext, Boolean, IUmbracoContextAccessor)
Initializes a new instance of the UmbracoContextReference class.
Declaration
public UmbracoContextReference(IUmbracoContext umbracoContext, bool isRoot, IUmbracoContextAccessor umbracoContextAccessor)
Parameters
Type | Name | Description |
---|---|---|
IUmbracoContext | umbracoContext | |
System.Boolean | isRoot | |
IUmbracoContextAccessor | umbracoContextAccessor |
Properties
View SourceIsRoot
Gets a value indicating whether the reference is a root reference.
Declaration
public bool IsRoot { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
UmbracoContext
Gets the UmbracoContext.
Declaration
public IUmbracoContext UmbracoContext { get; }
Property Value
Type | Description |
---|---|
IUmbracoContext |
Methods
View SourceDispose()
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |