Click or drag to resize

RegistrationExtensionsRegisterCompositeTComposite, TService Method (ContainerBuilder)

Register a composite type that should always provide the instance of TService when it is resolved, regardless of what other registrations for TService are available.

Composite registrations are not included when resolving a collection of TService.

Namespace:  Autofac
Assembly:  Autofac (in Autofac.dll) Version: 6.0.0+39696a967e8826f7f1ebc8c1ff4523c9dd75abe0
public static IRegistrationBuilder<TComposite, ConcreteReflectionActivatorData, SingleRegistrationStyle> RegisterComposite<TComposite, TService>(
	this ContainerBuilder builder
where TComposite : TService


Type: AutofacContainerBuilder
Container builder.

Type Parameters

Service type of the composite. Must accept a parameter of type IEnumerableT, IListT or TService[][], which will be set to collection of registered implementations.
Service type to provide a composite for.

Return Value

Type: IRegistrationBuilderTComposite, ConcreteReflectionActivatorData, SingleRegistrationStyle

[Missing <returns> documentation for "M:Autofac.RegistrationExtensions.RegisterComposite``2(Autofac.ContainerBuilder)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ContainerBuilder. 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).
See Also