Class ScopeContextualBase
Provides a base class for scope contextual objects.
Inheritance
object
Namespace: Umbraco.Cms.Core.Scoping
Assembly: Umbraco.Infrastructure.dll
Syntax
public abstract class ScopeContextualBase
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()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Remarks
If not scoped, then this releases the contextual object.
Get<T>(ICoreScopeProvider, string, Func<bool, T>)
Gets a contextual object.
Declaration
public static T? Get<T>(ICoreScopeProvider scopeProvider, string key, Func<bool, T> ctor) where T : ScopeContextualBase
Parameters
| Type | Name | Description |
|---|---|---|
| ICoreScopeProvider | scopeProvider | A scope provider. |
| string | key | A context key for the object. |
| Func<bool, 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(bool)
Releases the contextual object.
Declaration
public abstract void Release(bool completed)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | completed | A value indicating whether the scoped operation completed. |