C# Class Revenj.Extensibility.Autofac.ContainerBuilder

Used to build an IContainer from component registrations.
Most ContainerBuilder functionality is accessed via extension methods in RegistrationExtensions.
Inheritance: IObjectFactoryBuilder
Show file Open project: ngs-doo/revenj Class Usage Examples

Public Methods

Method Description
Add ( IFactoryBuilderFunc item ) : void
Add ( IFactoryBuilderInstance item ) : void
Add ( IFactoryBuilderType item ) : void
Build ( ContainerBuildOptions options = ContainerBuildOptions.Default ) : IContainer

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

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.

RegisterCallback ( Action configurationCallback ) : void

Register a callback that will be invoked when the container is configured.

This is primarily for extending the builder syntax.

Private Methods

Method Description
Build ( IComponentRegistry componentRegistry, bool excludeDefaultModules ) : void
RegisterDefaultAdapters ( IComponentRegistry componentRegistry ) : void
StartStartableComponents ( IComponentContext componentContext ) : void
Update ( IComponentRegistry componentRegistry ) : void

Method Details

Add() public method

public Add ( IFactoryBuilderFunc item ) : void
item IFactoryBuilderFunc
return void

Add() public method

public Add ( IFactoryBuilderInstance item ) : void
item IFactoryBuilderInstance
return void

Add() public method

public Add ( IFactoryBuilderType item ) : void
item IFactoryBuilderType
return void

Build() public method

Create a new container with the component registrations that have been made.
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.
public Build ( ContainerBuildOptions options = ContainerBuildOptions.Default ) : IContainer
options ContainerBuildOptions Options that influence the way the container is initialised.
return IContainer

RegisterCallback() public method

Register a callback that will be invoked when the container is configured.
This is primarily for extending the builder syntax.
public RegisterCallback ( Action configurationCallback ) : void
configurationCallback Action Callback to execute.
return void