Stashbox by Peter Csajtai

<PackageReference Include="Stashbox" Version="2.9.0-preview-517" />

 IResolutionScope

public interface IResolutionScope : IDisposable
Represents a resolution scope.
bool HasScopedInstances { get; }

True if the scope contains scoped instances, otherwise false.

object Name { get; }

The name of the scope, if it's null then it's a regular nameless scope.

The parent scope.

TDisposable AddDisposableTracking<TDisposable>(TDisposable disposable) where TDisposable : IDisposable

Adds a service for further disposable tracking.

void AddScopedInstance(Type key, object value, object name = null)

Adds or updates an instance in the scope.

TService AddWithFinalizer<TService>(TService finalizable, Action<TService> finalizer)

Adds a service with a cleanup delegate.

Called by every node of the internal graph when the RuntimeCircularDependencyTrackingEnabled is true. Checks for runtime circular dependencies in the compiled delegates.

Gets the names of the already opened scopes.

object GetOrAddScopedItem(int key, object sync, Func<IResolutionScope, object> factory)

Gets or adds an item to the scope.

object GetScopedInstanceOrDefault(Type key, object name = null)

Gets an instance from the scope.

Invalidates the delegate cache.

Called by every node of the internal graph when the RuntimeCircularDependencyTrackingEnabled is true. Resets the runtime circular dependency checks state for a node.