Click or drag to resize

RegistrationBuilder Class

Static factory methods to simplify the creation and handling of IRegistrationBuilder{L,A,R}.
Inheritance Hierarchy
SystemObject
  Autofac.BuilderRegistrationBuilder

Namespace:  Autofac.Builder
Assembly:  Autofac (in Autofac.dll) Version: 6.0.0+39696a967e8826f7f1ebc8c1ff4523c9dd75abe0
Syntax
public static class RegistrationBuilder

The RegistrationBuilder type exposes the following members.

Methods
  NameDescription
Public methodStatic memberCreateRegistration(Guid, RegistrationData, IInstanceActivator, IResolvePipelineBuilder, Service)
Create an IComponentRegistration from data.
Public methodStatic memberCreateRegistration(Guid, RegistrationData, IInstanceActivator, IResolvePipelineBuilder, Service, IComponentRegistration)
Create an IComponentRegistration from data.
Public methodStatic memberCode exampleCreateRegistrationTLimit, TActivatorData, TSingleRegistrationStyle(IRegistrationBuilderTLimit, TActivatorData, TSingleRegistrationStyle)
Create an IComponentRegistration from a RegistrationBuilder. There is no need to call this method when registering components through a ContainerBuilder.
Public methodStatic memberForDelegate(Type, FuncIComponentContext, IEnumerableParameter, Object)
Creates a registration builder for the provided delegate.
Public methodStatic memberForDelegateT(FuncIComponentContext, IEnumerableParameter, T)
Creates a registration builder for the provided delegate.
Public methodStatic memberForType(Type)
Creates a registration builder for the provided type.
Public methodStatic memberForTypeTImplementer
Creates a registration builder for the provided type.
Public methodStatic memberRegisterSingleComponentTLimit, 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