Share via


Extensions.RegisterKeyedType<TImplementer,TLimit> Method

Definition

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

Autofac.Builder.IRegistrationBuilder<TImplementer,Autofac.Builder.ConcreteReflectionActivatorData,Autofac.Builder.SingleRegistrationStyle>

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.

Applies to