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: 4.9.1+831973f4d02fbc619921dfaa8ac0c536f60ae7a3
Syntax
public static class RegistrationBuilder

The RegistrationBuilder type exposes the following members.

Methods
  NameDescription
Public methodStatic memberCreateRegistration(Guid, RegistrationData, IInstanceActivator, Service)
Create an IComponentRegistration from data.
Public methodStatic memberCreateRegistration(Guid, RegistrationData, IInstanceActivator, 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