Class ScopeContextualBase
Provides a base class for scope contextual objects.
Inheritance
System.Object
Namespace: Umbraco.Core.Scoping
Assembly: Umbraco.Core.dll
Syntax
public abstract class ScopeContextualBase : IDisposable
Remarks
A scope contextual object is enlisted in the current scope context, if any, and released when the context exists. It must be used in a 'using' block, and will be released when disposed, if not part of a scope.
Methods
View SourceDispose()
Declaration
public void Dispose()
Remarks
If not scoped, then this releases the contextual object.
Get<T>(IScopeProvider, String, Func<Boolean, T>)
Gets a contextual object.
Declaration
public static T Get<T>(IScopeProvider scopeProvider, string key, Func<bool, T> ctor)
where T : ScopeContextualBase
Parameters
Type | Name | Description |
---|---|---|
IScopeProvider | scopeProvider | A scope provider. |
System.String | key | A context key for the object. |
System.Func<System.Boolean, T> | ctor | A function producing the contextual object. |
Returns
Type | Description |
---|---|
T | The contextual object. |
Type Parameters
Name | Description |
---|---|
T | The type of the object. |
Remarks
Release(Boolean)
Releases the contextual object.
Declaration
public abstract void Release(bool completed)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | completed | A value indicating whether the scoped operation completed. |