RegistrationExtensionsRegisterComposite Method (ContainerBuilder, Type, Type) |
Register a composite type that should always provide the instance of serviceType when it is resolved,
regardless of what other registrations for serviceType are available.
Composite registrations are not included when resolving a collection of serviceType.
Namespace:
Autofac
Assembly:
Autofac (in Autofac.dll) Version: 6.0.0+39696a967e8826f7f1ebc8c1ff4523c9dd75abe0
Syntax public static IRegistrationBuilder<Object, ConcreteReflectionActivatorData, SingleRegistrationStyle> RegisterComposite(
this ContainerBuilder builder,
Type compositeType,
Type serviceType
)
<ExtensionAttribute>
Public Shared Function RegisterComposite (
builder As ContainerBuilder,
compositeType As Type,
serviceType As Type
) As IRegistrationBuilder(Of Object, ConcreteReflectionActivatorData, SingleRegistrationStyle)
Parameters
- builder
- Type: AutofacContainerBuilder
Container builder. - compositeType
- Type: SystemType
Service type of the composite. Must accept a parameter
of type IEnumerableT, IListT or an array of serviceType,
which will be set to the collection of registered implementations.
- serviceType
- Type: SystemType
Service type to provide a composite for.
Return Value
Type:
IRegistrationBuilderObject,
ConcreteReflectionActivatorData,
SingleRegistrationStyle[Missing <returns> documentation for "M:Autofac.RegistrationExtensions.RegisterComposite(Autofac.ContainerBuilder,System.Type,System.Type)"]
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