Used to build an IContainer from component registrations.
| C# | Visual Basic | Visual C++ |
public class ContainerBuilder
Public Class ContainerBuilder
public ref class ContainerBuilder
| All Members | Constructors | Methods | Properties | ||
| Icon | Member | Description |
|---|---|---|
| ContainerBuilder()()() | Initializes a new instance of the ContainerBuilder class | |
| Build()()() |
Create a new container with the component registrations that have been made.
| |
| Equals(Object) | (Inherited from Object.) | |
| ExcludeDefaultModules |
If set to true, standard container functionality like resolve-all, auto-generated
factories and owned-instances will not be registered by this builder.
| |
| Finalize()()() |
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.) | |
| GetHashCode()()() |
Serves as a hash function for a particular type.
(Inherited from Object.) | |
| GetType()()() |
Gets the Type of the current instance.
(Inherited from Object.) | |
| MemberwiseClone()()() |
Creates a shallow copy of the current Object.
(Inherited from Object.) | |
| RegisterCallback(Action<(Of <(IComponentRegistry>)>)) |
Register a callback that will be invoked when the container is configured.
| |
| ToString()()() | (Inherited from Object.) |
Most ContainerBuilder functionality is accessed
via extension methods in RegistrationExtensions.
var builder = new ContainerBuilder(); builder.RegisterType<Logger>() .As<ILogger>() .SingleInstance(); builder.Register(c => new MessageHandler(c.Resolve<ILogger>())); var container = builder.Build(); // resolve components from container...
| Object | |
| ContainerBuilder | |