Table of Contents

Method RegisterGenericDecorator

Namespace
Autofac
Assembly
Autofac.dll

RegisterGenericDecorator(ContainerBuilder, Type, Type, object, object?)

public static IRegistrationBuilder<object, OpenGenericDecoratorActivatorData, DynamicRegistrationStyle> RegisterGenericDecorator(this ContainerBuilder builder, Type decoratorType, Type decoratedServiceType, object fromKey, object? toKey = null)

Parameters

builder ContainerBuilder
decoratorType Type
decoratedServiceType Type
fromKey object
toKey object

Returns

IRegistrationBuilder<object, OpenGenericDecoratorActivatorData, DynamicRegistrationStyle>

RegisterGenericDecorator(ContainerBuilder, Type, Type, Func<IDecoratorContext, bool>?)

public static void RegisterGenericDecorator(this ContainerBuilder builder, Type decoratorType, Type serviceType, Func<IDecoratorContext, bool>? condition = null)

Parameters

builder ContainerBuilder
decoratorType Type
serviceType Type
condition Func<IDecoratorContext, bool>