Interface IScopeProvider
Provides scopes.
Namespace:System.Dynamic.ExpandoObject
Assembly:Umbraco.Core.dll
Syntax
public interface IScopeProvider
Properties
Context
Gets the scope context.
Declaration
ScopeContext Context { get; }
Property Value
Type | Description |
---|---|
ScopeContext |
Methods
AttachScope(IScope, Boolean)
Attaches a scope.
Declaration
void AttachScope(IScope scope, bool callContext = false)
Parameters
Type | Name | Description |
---|---|---|
IScope | scope | The scope to attach. |
System.Boolean | callContext | A value indicating whether to force usage of call context. |
Remarks
Only a scope created by CreateDetachedScope(IsolationLevel, RepositoryCacheMode, IEventDispatcher, Nullable<Boolean>) can be attached.
CreateDetachedScope(IsolationLevel, RepositoryCacheMode, IEventDispatcher, Nullable<Boolean>)
Creates a detached scope.
Declaration
IScope CreateDetachedScope(IsolationLevel isolationLevel = IsolationLevel.Unspecified, RepositoryCacheMode repositoryCacheMode = RepositoryCacheMode.Unspecified, IEventDispatcher eventDispatcher = null, bool ? scopeFileSystems = null)
Parameters
Type | Name | Description |
---|---|---|
System.Data.IsolationLevel | isolationLevel | |
RepositoryCacheMode | repositoryCacheMode | |
IEventDispatcher | eventDispatcher | |
System.Nullable<System.Boolean> | scopeFileSystems |
Returns
Type | Description |
---|---|
IScope | A detached scope. |
Remarks
A detached scope is not ambient and has no parent.
It is meant to be attached by AttachScope(IScope, Boolean).
CreateScope(IsolationLevel, RepositoryCacheMode, IEventDispatcher, Nullable<Boolean>, Boolean)
Creates an ambient scope.
Declaration
IScope CreateScope(IsolationLevel isolationLevel = IsolationLevel.Unspecified, RepositoryCacheMode repositoryCacheMode = RepositoryCacheMode.Unspecified, IEventDispatcher eventDispatcher = null, bool ? scopeFileSystems = null, bool callContext = false)
Parameters
Type | Name | Description |
---|---|---|
System.Data.IsolationLevel | isolationLevel | |
RepositoryCacheMode | repositoryCacheMode | |
IEventDispatcher | eventDispatcher | |
System.Nullable<System.Boolean> | scopeFileSystems | |
System.Boolean | callContext |
Returns
Type | Description |
---|---|
IScope | The created ambient scope. |
Remarks
The created scope becomes the ambient scope.
If an ambient scope already exists, it becomes the parent of the created scope.
When the created scope is disposed, the parent scope becomes the ambient scope again.
DetachScope()
Detaches a scope.
Declaration
IScope DetachScope()
Returns
Type | Description |
---|---|
IScope | The detached scope. |
Remarks
Only a scope previously attached by AttachScope(IScope, Boolean) can be detached.