RegistrationBuilder Class |
Static factory methods to simplify the creation and handling of IRegistrationBuilder{L,A,R}.
Inheritance Hierarchy
Namespace:
Autofac.Builder
Assembly:
Autofac (in Autofac.dll) Version: 6.0.0+39696a967e8826f7f1ebc8c1ff4523c9dd75abe0
Syntaxpublic static class RegistrationBuilder
<ExtensionAttribute>
Public NotInheritable Class RegistrationBuilder
The RegistrationBuilder type exposes the following members.
Methods
| Name | Description |
---|
  | CreateRegistration(Guid, RegistrationData, IInstanceActivator, IResolvePipelineBuilder, Service) |
Create an IComponentRegistration from data.
|
  | CreateRegistration(Guid, RegistrationData, IInstanceActivator, IResolvePipelineBuilder, Service, IComponentRegistration) |
Create an IComponentRegistration from data.
|
   | CreateRegistrationTLimit, TActivatorData, TSingleRegistrationStyle(IRegistrationBuilderTLimit, TActivatorData, TSingleRegistrationStyle) | |
  | ForDelegate(Type, FuncIComponentContext, IEnumerableParameter, Object) |
Creates a registration builder for the provided delegate.
|
  | ForDelegateT(FuncIComponentContext, IEnumerableParameter, T) |
Creates a registration builder for the provided delegate.
|
  | ForType(Type) |
Creates a registration builder for the provided type.
|
  | ForTypeTImplementer |
Creates a registration builder for the provided type.
|
  | RegisterSingleComponentTLimit, TActivatorData, TSingleRegistrationStyle |
Register a component in the component registry. This helper method is necessary
in order to execute OnRegistered hooks and respect PreserveDefaults.
|
Top
Examples
To create an
IComponentRegistration for a specific type, use:
var cr = RegistrationBuilder.ForType(t).CreateRegistration();
The full builder syntax is supported.
var cr = RegistrationBuilder.ForType(t).Named("foo").ExternallyOwned().CreateRegistration();
See Also