Click or drag to resize

ContainerBuilderBuild Method

Create a new container with the component registrations that have been made.

Namespace:  Autofac
Assembly:  Autofac (in Autofac.dll) Version: 6.0.0+39696a967e8826f7f1ebc8c1ff4523c9dd75abe0
Syntax
public IContainer Build(
	ContainerBuildOptions options = ContainerBuildOptions.None
)

Parameters

options (Optional)
Type: Autofac.BuilderContainerBuildOptions
Options that influence the way the container is initialised.

Return Value

Type: IContainer
A new container with the configured component registrations.
Remarks
Build can only be called once per ContainerBuilder - this prevents ownership issues for provided instances. Build enables support for the relationship types that come with Autofac (e.g. Func, Owned, Meta, Lazy, IEnumerable.) To exclude support for these types, first create the container, then call Update() on the builder.
See Also