Extensions.RegisterKeyedType<TImplementer,TLimit> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Register a component to be created through reflection, and provide a key that can be used to retrieve the component.
public static Autofac.Builder.IRegistrationBuilder<TImplementer,Autofac.Builder.ConcreteReflectionActivatorData,Autofac.Builder.SingleRegistrationStyle> RegisterKeyedType<TImplementer,TLimit> (this Autofac.ContainerBuilder builder);
static member RegisterKeyedType : Autofac.ContainerBuilder -> Autofac.Builder.IRegistrationBuilder<'Implementer, Autofac.Builder.ConcreteReflectionActivatorData, Autofac.Builder.SingleRegistrationStyle>
<Extension()>
Public Function RegisterKeyedType(Of TImplementer, TLimit) (builder As ContainerBuilder) As IRegistrationBuilder(Of TImplementer, ConcreteReflectionActivatorData, SingleRegistrationStyle)
Type Parameters
- TImplementer
The type of the component implementation.
- TLimit
The service type provided by the component.
Parameters
- builder
- Autofac.ContainerBuilder
Container builder.
Returns
Registration builder allowing the registration to be configured.
Remarks
This method leverages Autofac's autowiring of components through reflection, providing a key that directly reflects that component type, so that it might be retrieved by that key and possibly replaced in an adapter chain.