Creates, wires dependencies and manages lifetime for a set of components.
Most instances of IContainer are created
by a ContainerBuilder.
| C# | Visual Basic | Visual C++ |
public interface IContainer : ILifetimeScope, IComponentContext, IDisposable
Public Interface IContainer _ Implements ILifetimeScope, IComponentContext, IDisposable
public interface class IContainer : ILifetimeScope, IComponentContext, IDisposable
| All Members | Methods | Properties | |||
| Icon | Member | Description |
|---|---|---|
| BeginLifetimeScope()()() |
Begin a new nested scope. Component instances created via the new scope
will be disposed along with it.
(Inherited from ILifetimeScope.) | |
| BeginLifetimeScope(Object) |
Begin a new nested scope. Component instances created via the new scope
will be disposed along with it.
(Inherited from ILifetimeScope.) | |
| BeginLifetimeScope(Action<(Of <(ContainerBuilder>)>)) |
Begin a new nested scope, with additional components available to it.
Component instances created via the new scope
will be disposed along with it.
(Inherited from ILifetimeScope.) | |
| BeginLifetimeScope(Object, Action<(Of <(ContainerBuilder>)>)) |
Begin a new nested scope, with additional components available to it.
Component instances created via the new scope
will be disposed along with it.
(Inherited from ILifetimeScope.) | |
| ComponentRegistry |
Associates services with the components that provide them.
(Inherited from IComponentContext.) | |
| Dispose()()() |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from IDisposable.) | |
| Disposer |
The disposer associated with this ILifetimeScope.
Component instances can be associated with it manually if required.
(Inherited from ILifetimeScope.) | |
| Resolve(IComponentRegistration, IEnumerable<(Of <(Parameter>)>)) |
Resolve an instance of the provided registration within the context.
(Inherited from IComponentContext.) | |
| Tag |
The tag applied to the ILifetimeScope.
(Inherited from ILifetimeScope.) |
Most IContainer functionality is provided by extension methods
on the inherited IComponentContext interface.
// See ContainerBuilder for the definition of the builder variable using (var container = builder.Build()) { var program = container.Resolve<Program>(); program.Run(); }