Autofac .NET Inversion of Control Container
IContainer Interface
NamespacesAutofacIContainer
Creates, wires dependencies and manages lifetime for a set of components. Most instances of IContainer are created by a ContainerBuilder.
Declaration Syntax
C#Visual BasicVisual C++
public interface IContainer : ILifetimeScope, 
	IComponentContext, IDisposable
Public Interface IContainer _
	Implements ILifetimeScope, IComponentContext, IDisposable
public interface class IContainer : ILifetimeScope, 
	IComponentContext, IDisposable
Members
All MembersMethodsProperties



IconMemberDescription
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.)
Remarks
Most IContainer functionality is provided by extension methods on the inherited IComponentContext interface.
Examples
CopyC#
// See ContainerBuilder for the definition of the builder variable
using (var container = builder.Build())
{
    var program = container.Resolve<Program>();
    program.Run();
}
See Also

Assembly: Autofac (Module: Autofac) Version: 2.1.13.813 (2.1.13.813)