Table of Contents

Method RegisterDecorator

Namespace
Autofac
Assembly
Autofac.dll

RegisterDecorator<TService>(ContainerBuilder, Func<IComponentContext, IEnumerable<Parameter>, TService, TService>, object, object?)

public static IRegistrationBuilder<TService, LightweightAdapterActivatorData, DynamicRegistrationStyle> RegisterDecorator<TService>(this ContainerBuilder builder, Func<IComponentContext, IEnumerable<Parameter>, TService, TService> decorator, object fromKey, object? toKey = null) where TService : notnull

Parameters

builder ContainerBuilder
decorator Func<IComponentContext, IEnumerable<Parameter>, TService, TService>
fromKey object
toKey object

Returns

IRegistrationBuilder<TService, LightweightAdapterActivatorData, DynamicRegistrationStyle>

Type Parameters

TService

RegisterDecorator<TService>(ContainerBuilder, Func<IComponentContext, TService, TService>, object, object?)

public static IRegistrationBuilder<TService, LightweightAdapterActivatorData, DynamicRegistrationStyle> RegisterDecorator<TService>(this ContainerBuilder builder, Func<IComponentContext, TService, TService> decorator, object fromKey, object? toKey = null) where TService : notnull

Parameters

builder ContainerBuilder
decorator Func<IComponentContext, TService, TService>
fromKey object
toKey object

Returns

IRegistrationBuilder<TService, LightweightAdapterActivatorData, DynamicRegistrationStyle>

Type Parameters

TService

RegisterDecorator<TService>(ContainerBuilder, Func<TService, TService>, object, object?)

public static IRegistrationBuilder<TService, LightweightAdapterActivatorData, DynamicRegistrationStyle> RegisterDecorator<TService>(this ContainerBuilder builder, Func<TService, TService> decorator, object fromKey, object? toKey = null) where TService : notnull

Parameters

builder ContainerBuilder
decorator Func<TService, TService>
fromKey object
toKey object

Returns

IRegistrationBuilder<TService, LightweightAdapterActivatorData, DynamicRegistrationStyle>

Type Parameters

TService

RegisterDecorator<TDecorator, TService>(ContainerBuilder, Func<IDecoratorContext, bool>?)

public static void RegisterDecorator<TDecorator, TService>(this ContainerBuilder builder, Func<IDecoratorContext, bool>? condition = null) where TDecorator : notnull, TService

Parameters

builder ContainerBuilder
condition Func<IDecoratorContext, bool>

Type Parameters

TDecorator
TService

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

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

Parameters

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

RegisterDecorator<TService>(ContainerBuilder, Func<IComponentContext, IEnumerable<Parameter>, TService, TService>, Func<IDecoratorContext, bool>?)

public static void RegisterDecorator<TService>(this ContainerBuilder builder, Func<IComponentContext, IEnumerable<Parameter>, TService, TService> decorator, Func<IDecoratorContext, bool>? condition = null) where TService : class

Parameters

builder ContainerBuilder
decorator Func<IComponentContext, IEnumerable<Parameter>, TService, TService>
condition Func<IDecoratorContext, bool>

Type Parameters

TService