Interface IDependencyScope
- Namespace
- LfrlAnvil.Dependencies
- Assembly
- LfrlAnvil.Dependencies.dll
Represents a dependency scope.
public interface IDependencyScope : IDependencyScopeFactory
- Inherited Members
Properties
Container
IDependencyContainer associated with this scope.
IDependencyContainer Container { get; }
Property Value
IsDisposed
Specifies whether this scope has been disposed.
bool IsDisposed { get; }
Property Value
IsRoot
Specifies whether this scope is a root scope.
[MemberNotNullWhen(false, "ParentScope")]
bool IsRoot { get; }
Property Value
Level
Depth of this scope. Equal to 0 when this scope is a root scope.
int Level { get; }
Property Value
Locator
Non-keyed dependency locator associated with this scope.
IDependencyLocator Locator { get; }
Property Value
Name
Optional name of this scope. If it is not null then this scope can be retrieved by invoking the GetScope(string) method.
string? Name { get; }
Property Value
OriginalThreadId
Specifies the CurrentManagedThreadId of the Thread that created this scope.
int OriginalThreadId { get; }
Property Value
ParentScope
Parent scope of this scope or null when this scope is a root scope.
IDependencyScope? ParentScope { get; }
Property Value
Methods
GetChildren()
Retrieves all child scopes created by this scope.
[Pure]
IDependencyScope[] GetChildren()
Returns
- IDependencyScope[]
Collection of child scopes created by this scope.
GetKeyedLocator<TKey>(TKey)
Gets the keyed locator associated with this scope by its key.
[Pure]
IDependencyLocator<TKey> GetKeyedLocator<TKey>(TKey key) where TKey : notnull
Parameters
keyTKeyLocator's key.
Returns
- IDependencyLocator<TKey>
IDependencyLocator<TKey> instance associated with this scope and the provided
key.
Type Parameters
TKeyLocator's key type.
GetTypeErasedKeyedLocator(object)
Gets the keyed locator associated with this scope by its key.
[Pure]
IDependencyLocator GetTypeErasedKeyedLocator(object key)
Parameters
keyobjectLocator's key.
Returns
- IDependencyLocator
IDependencyLocator instance associated with this scope and the provided
key.