Table of Contents

Class DependencyContainer

Namespace
LfrlAnvil.Dependencies
Assembly
LfrlAnvil.Dependencies.dll

Represents a disposable dependency container.

public sealed class DependencyContainer : IDisposableDependencyContainer, IDependencyContainer, IDisposable
Inheritance
DependencyContainer
Implements
Inherited Members

Properties

RootScope

Specifies the root scope of this container.

public IDependencyScope RootScope { get; }

Property Value

IDependencyScope

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Remarks

Disposes the RootScope.

GetScope(string)

Returns the named scope.

[Pure]
public IDependencyScope GetScope(string name)

Parameters

name string

Scope's name.

Returns

IDependencyScope

Named IDependencyScope instance.

Exceptions

DependencyScopeNotFoundException

When named scope does not exist.

TryGetScope(string)

Attempts to return the named scope.

[Pure]
public IDependencyScope? TryGetScope(string name)

Parameters

name string

Scope's name.

Returns

IDependencyScope

Named IDependencyScope instance or null when named scope does not exist.