Class AutofacGenericDecoratorBasedServiceResolutionInfoBuilderAdapter<TService>
A generic builder which creates an instance of DecoratorBasedServiceResolutionInfo.
Inheritance
Implements
Inherited Members
Namespace: CSF.DecoratorBuilder
Assembly: CSF.DecoratorBuilder.Autofac.dll
Syntax
public class AutofacGenericDecoratorBasedServiceResolutionInfoBuilderAdapter<TService> : IAutofacGenericDecoratorBuilder<TService>, ICreatesAutofacDecorator<TService>, ICustomizesAutofacDecorator<TService>, IHasDecoratorBasedServiceResolutionInfo where TService : class
Type Parameters
Name | Description |
---|---|
TService | The overall type of the service to be created. |
Remarks
Instances of this builder class must be used a maximum of once. They are not reusable.
Constructors
| Improve this Doc View SourceAutofacGenericDecoratorBasedServiceResolutionInfoBuilderAdapter(IGenericDecoratorBuilder<TService>)
Initialises a new instance of AutofacGenericDecoratorBasedServiceResolutionInfoBuilderAdapter<TService>.
Declaration
public AutofacGenericDecoratorBasedServiceResolutionInfoBuilderAdapter(IGenericDecoratorBuilder<TService> wrapped)
Parameters
Type | Name | Description |
---|---|---|
IGenericDecoratorBuilder<TService> | wrapped | The wrapped builder |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
Properties
| Improve this Doc View SourceResolutionInfo
Gets the resolution information for the decorator-based services.
Declaration
public DecoratorBasedServiceResolutionInfo ResolutionInfo { get; }
Property Value
Type | Description |
---|---|
DecoratorBasedServiceResolutionInfo |
Methods
| Improve this Doc View SourceThenWrapWith<TDecorator>(Parameter[])
Selects a decorator type using a generic type parameter. The implementation directly before this point in the decorator 'stack' (be it the initial implementation or a decorator itself) will be passed to the selected implementation. Thus this implementation will 'wrap' the one before it.
Declaration
public ICustomizesAutofacDecorator<TService> ThenWrapWith<TDecorator>(params Parameter[] parameters)
where TDecorator : class, TService
Parameters
Type | Name | Description |
---|---|---|
Autofac.Core.Parameter[] | parameters | An optional collection of Autofac.Core.Parameter. |
Returns
Type | Description |
---|---|
ICustomizesAutofacDecorator<TService> | A customisation helper by which further implementations may be added to the decorator 'stack'. |
Type Parameters
Name | Description |
---|---|
TDecorator | The type of the concrete implementation to use as a decorator. |
ThenWrapWith<TDecorator>(Func<TService, IComponentContext, IEnumerable<Parameter>, TDecorator>, Parameter[])
Selects a decorator type using a generic type parameter. The implementation directly before this point in the decorator 'stack' (be it the initial implementation or a decorator itself) will be passed to the selected implementation. Thus this implementation will 'wrap' the one before it.
Declaration
public ICustomizesAutofacDecorator<TService> ThenWrapWith<TDecorator>(Func<TService, IComponentContext, IEnumerable<Parameter>, TDecorator> factoryFunction, params Parameter[] parameters)
where TDecorator : class, TService
Parameters
Type | Name | Description |
---|---|---|
System.Func<TService, Autofac.IComponentContext, System.Collections.Generic.IEnumerable<Autofac.Core.Parameter>, TDecorator> | factoryFunction | A function which creates the instance of the decorator type. |
Autofac.Core.Parameter[] | parameters | An optional collection of Autofac.Core.Parameter. |
Returns
Type | Description |
---|---|
ICustomizesAutofacDecorator<TService> | A customisation helper by which further implementations may be added to the decorator 'stack'. |
Type Parameters
Name | Description |
---|---|
TDecorator | The type of the concrete implementation to use as a decorator. |
ThenWrapWithType(Type, Parameter[])
Selects a decorator type. The implementation directly before this point in the decorator 'stack' (be it the initial implementation or a decorator itself) will be passed to the selected implementation. Thus this implementation will 'wrap' the one before it.
Declaration
public ICustomizesAutofacDecorator<TService> ThenWrapWithType(Type decoratorType, params Parameter[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Type | decoratorType | The type of the concrete implementation to use as a decorator. |
Autofac.Core.Parameter[] | parameters | An optional collection of Autofac.Core.Parameter. |
Returns
Type | Description |
---|---|
ICustomizesAutofacDecorator<TService> | A customisation helper by which further implementations may be added to the decorator 'stack'. |
ThenWrapWithType(Type, Func<TService, IComponentContext, IEnumerable<Parameter>, TService>, Parameter[])
Selects a decorator type. The implementation directly before this point in the decorator 'stack' (be it the initial implementation or a decorator itself) will be passed to the selected implementation. Thus this implementation will 'wrap' the one before it.
Declaration
public ICustomizesAutofacDecorator<TService> ThenWrapWithType(Type decoratorType, Func<TService, IComponentContext, IEnumerable<Parameter>, TService> factoryFunction, params Parameter[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Type | decoratorType | The type of the concrete implementation to use as a decorator. |
System.Func<TService, Autofac.IComponentContext, System.Collections.Generic.IEnumerable<Autofac.Core.Parameter>, TService> | factoryFunction | A function which creates the instance of the decorator type. |
Autofac.Core.Parameter[] | parameters | An optional collection of Autofac.Core.Parameter. |
Returns
Type | Description |
---|---|
ICustomizesAutofacDecorator<TService> | A customisation helper by which further implementations may be added to the decorator 'stack'. |
UsingInitialImpl<TInitialImpl>(Parameter[])
Selects the initial implementation type using a generic type parameter.
Declaration
public ICustomizesAutofacDecorator<TService> UsingInitialImpl<TInitialImpl>(params Parameter[] parameters)
where TInitialImpl : class, TService
Parameters
Type | Name | Description |
---|---|---|
Autofac.Core.Parameter[] | parameters | An optional collection of Autofac.Core.Parameter. |
Returns
Type | Description |
---|---|
ICustomizesAutofacDecorator<TService> | A customisation helper by which further implementations may be added to the decorator 'stack'. |
Type Parameters
Name | Description |
---|---|
TInitialImpl | The type of the initial concrete implementation. |
UsingInitialImpl<TInitialImpl>(Func<IComponentContext, IEnumerable<Parameter>, TInitialImpl>, Parameter[])
Selects the initial implementation type using a generic type parameter.
Declaration
public ICustomizesAutofacDecorator<TService> UsingInitialImpl<TInitialImpl>(Func<IComponentContext, IEnumerable<Parameter>, TInitialImpl> factoryFunction, params Parameter[] parameters)
where TInitialImpl : class, TService
Parameters
Type | Name | Description |
---|---|---|
System.Func<Autofac.IComponentContext, System.Collections.Generic.IEnumerable<Autofac.Core.Parameter>, TInitialImpl> | factoryFunction | A function which creates the instance of the implementation type. |
Autofac.Core.Parameter[] | parameters | An optional collection of Autofac.Core.Parameter. |
Returns
Type | Description |
---|---|
ICustomizesAutofacDecorator<TService> | A customisation helper by which further implementations may be added to the decorator 'stack'. |
Type Parameters
Name | Description |
---|---|
TInitialImpl | The type of the initial concrete implementation. |
UsingInitialImplType(Type, Parameter[])
Selects the initial implementation type.
Declaration
public ICustomizesAutofacDecorator<TService> UsingInitialImplType(Type initialImplType, params Parameter[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Type | initialImplType | The type of the initial concrete implementation. |
Autofac.Core.Parameter[] | parameters | An optional collection of Autofac.Core.Parameter. |
Returns
Type | Description |
---|---|
ICustomizesAutofacDecorator<TService> | A customisation helper by which further implementations may be added to the decorator 'stack'. |
UsingInitialImplType(Type, Func<IComponentContext, IEnumerable<Parameter>, TService>, Parameter[])
Selects the initial implementation type.
Declaration
public ICustomizesAutofacDecorator<TService> UsingInitialImplType(Type initialImplType, Func<IComponentContext, IEnumerable<Parameter>, TService> factoryFunction, params Parameter[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Type | initialImplType | The type of the initial concrete implementation. |
System.Func<Autofac.IComponentContext, System.Collections.Generic.IEnumerable<Autofac.Core.Parameter>, TService> | factoryFunction | A function which creates the instance of the implementation type. |
Autofac.Core.Parameter[] | parameters | An optional collection of Autofac.Core.Parameter. |
Returns
Type | Description |
---|---|
ICustomizesAutofacDecorator<TService> | A customisation helper by which further implementations may be added to the decorator 'stack'. |