Click or drag to resize

RegistrationBuilderCreateRegistrationTLimit, TActivatorData, TSingleRegistrationStyle Method (IRegistrationBuilderTLimit, TActivatorData, TSingleRegistrationStyle)

Create an IComponentRegistration from a RegistrationBuilder. There is no need to call this method when registering components through a ContainerBuilder.

Namespace:  Autofac.Builder
Assembly:  Autofac (in Autofac.dll) Version: 6.0.0+39696a967e8826f7f1ebc8c1ff4523c9dd75abe0
Syntax
public static IComponentRegistration CreateRegistration<TLimit, TActivatorData, TSingleRegistrationStyle>(
	this IRegistrationBuilder<TLimit, TActivatorData, TSingleRegistrationStyle> builder
)
where TActivatorData : IConcreteActivatorData
where TSingleRegistrationStyle : SingleRegistrationStyle

Parameters

builder
Type: Autofac.BuilderIRegistrationBuilderTLimit, TActivatorData, TSingleRegistrationStyle
The registration builder.

Type Parameters

TLimit

[Missing <typeparam name="TLimit"/> documentation for "M:Autofac.Builder.RegistrationBuilder.CreateRegistration``3(Autofac.Builder.IRegistrationBuilder{``0,``1,``2})"]

TActivatorData

[Missing <typeparam name="TActivatorData"/> documentation for "M:Autofac.Builder.RegistrationBuilder.CreateRegistration``3(Autofac.Builder.IRegistrationBuilder{``0,``1,``2})"]

TSingleRegistrationStyle

[Missing <typeparam name="TSingleRegistrationStyle"/> documentation for "M:Autofac.Builder.RegistrationBuilder.CreateRegistration``3(Autofac.Builder.IRegistrationBuilder{``0,``1,``2})"]

Return Value

Type: IComponentRegistration
An IComponentRegistration.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IRegistrationBuilderTLimit, TActivatorData, TSingleRegistrationStyle. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullException Thrown if builder is .
Remarks
When called on the result of one of the ContainerBuilder methods, the returned registration will be different from the one the builder itself registers in the container.
Examples
var registration = RegistrationBuilder.ForType<Foo>().CreateRegistration();
See Also