Class DecoratorContainerBuilderExtensions
Extension methods for the Autofac ContainerBuilder
.
Inheritance
Inherited Members
Namespace: Autofac
Assembly: CSF.DecoratorBuilder.Autofac.dll
Syntax
public static class DecoratorContainerBuilderExtensions
Methods
| Improve this Doc View SourceRegisterDecoratedService<TService>(ContainerBuilder, Func<ICreatesAutofacDecorator<TService>, Parameter[], ICustomizesAutofacDecorator<TService>>)
Registers a service created with the decorator pattern.
Declaration
public static IRegistrationBuilder<TService, SimpleActivatorData, SingleRegistrationStyle> RegisterDecoratedService<TService>(this ContainerBuilder builder, Func<ICreatesAutofacDecorator<TService>, Parameter[], ICustomizesAutofacDecorator<TService>> customizationFunc)
where TService : class
Parameters
Type | Name | Description |
---|---|---|
Autofac.ContainerBuilder | builder | A container builder. |
System.Func<ICreatesAutofacDecorator<TService>, Autofac.Core.Parameter[], ICustomizesAutofacDecorator<TService>> | customizationFunc | A customization function, to build the 'shape' of the decorated service. |
Returns
Type | Description |
---|---|
Autofac.Builder.IRegistrationBuilder<TService, Autofac.Builder.SimpleActivatorData, Autofac.Builder.SingleRegistrationStyle> | The registration builder. |
Type Parameters
Name | Description |
---|---|
TService | The service type, typically an interface. |
RegisterDecoratedService<TService>(ContainerBuilder, Func<ICreatesAutofacDecorator<TService>, ICustomizesAutofacDecorator<TService>>)
Registers a service created with the decorator pattern.
Declaration
public static IRegistrationBuilder<TService, SimpleActivatorData, SingleRegistrationStyle> RegisterDecoratedService<TService>(this ContainerBuilder builder, Func<ICreatesAutofacDecorator<TService>, ICustomizesAutofacDecorator<TService>> customizationFunc)
where TService : class
Parameters
Type | Name | Description |
---|---|---|
Autofac.ContainerBuilder | builder | A container builder. |
System.Func<ICreatesAutofacDecorator<TService>, ICustomizesAutofacDecorator<TService>> | customizationFunc | A customization function, to build the 'shape' of the decorated service. |
Returns
Type | Description |
---|---|
Autofac.Builder.IRegistrationBuilder<TService, Autofac.Builder.SimpleActivatorData, Autofac.Builder.SingleRegistrationStyle> | The registration builder. |
Type Parameters
Name | Description |
---|---|
TService | The service type, typically an interface. |
RegisterDecoratedServiceType(ContainerBuilder, Type, Func<ICreatesAutofacDecorator, Parameter[], ICustomizesAutofacDecorator>)
Registers a service type created with the decorator pattern.
Declaration
public static IRegistrationBuilder<object, SimpleActivatorData, SingleRegistrationStyle> RegisterDecoratedServiceType(this ContainerBuilder builder, Type serviceType, Func<ICreatesAutofacDecorator, Parameter[], ICustomizesAutofacDecorator> customizationFunc)
Parameters
Type | Name | Description |
---|---|---|
Autofac.ContainerBuilder | builder | A container builder. |
System.Type | serviceType | The service type, typically an interface. |
System.Func<ICreatesAutofacDecorator, Autofac.Core.Parameter[], ICustomizesAutofacDecorator> | customizationFunc | A customization function, to build the 'shape' of the decorated service. |
Returns
Type | Description |
---|---|
Autofac.Builder.IRegistrationBuilder<System.Object, Autofac.Builder.SimpleActivatorData, Autofac.Builder.SingleRegistrationStyle> | The registration builder. |
RegisterDecoratedServiceType(ContainerBuilder, Type, Func<ICreatesAutofacDecorator, ICustomizesAutofacDecorator>)
Registers a service type created with the decorator pattern.
Declaration
public static IRegistrationBuilder<object, SimpleActivatorData, SingleRegistrationStyle> RegisterDecoratedServiceType(this ContainerBuilder builder, Type serviceType, Func<ICreatesAutofacDecorator, ICustomizesAutofacDecorator> customizationFunc)
Parameters
Type | Name | Description |
---|---|---|
Autofac.ContainerBuilder | builder | A container builder. |
System.Type | serviceType | The service type, typically an interface. |
System.Func<ICreatesAutofacDecorator, ICustomizesAutofacDecorator> | customizationFunc | A customization function, to build the 'shape' of the decorated service. |
Returns
Type | Description |
---|---|
Autofac.Builder.IRegistrationBuilder<System.Object, Autofac.Builder.SimpleActivatorData, Autofac.Builder.SingleRegistrationStyle> | The registration builder. |