Skip to main content

Factory

An abstract class in Alta.VContainerLayer.Runtime, the global namespace.

Base for the VContainer factories. Holds the injected container and a disposer, and disposes everything it created when it is disposed.

Constructors​

MemberWhat it is
protected Factory()Creates a Factory with default values.

Fields​

MemberWhat it is
protected IObjectResolver containerThe injected VContainer resolver, used to inject or instantiate what the factory creates.
protected IDisposer disposerInjected disposer that collects created instances to dispose with the factory.

Methods​

MemberWhat it is
virtual void Dispose()Disposes every IDisposable instance this factory created, through the disposer.
protected void TryAddDisposable<TInstance>(TInstance instance)Adds the instance to the disposer if it implements IDisposable, so the factory's Dispose cleans it up.