Show / Hide Table of Contents

Class AutofacDecoratedServiceFactory

Implementation of IGetsAutofacDecoratedService which creates an appropriate builder, applies customisations and returns the resolved service, created using the decorator pattern.

Inheritance
System.Object
AutofacDecoratedServiceFactory
Implements
IGetsAutofacDecoratedService
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: CSF.DecoratorBuilder
Assembly: CSF.DecoratorBuilder.Autofac.dll
Syntax
public class AutofacDecoratedServiceFactory : IGetsAutofacDecoratedService

Constructors

| Improve this Doc View Source

AutofacDecoratedServiceFactory(IGetsDecoratedServiceFromResolutionInfo)

Initialises a new instance of AutofacDecoratedServiceFactory.

Declaration
public AutofacDecoratedServiceFactory(IGetsDecoratedServiceFromResolutionInfo resolver)
Parameters
Type Name Description
IGetsDecoratedServiceFromResolutionInfo resolver

An object which resolves services from a DecoratorBasedServiceResolutionInfo.

Exceptions
Type Condition
System.ArgumentNullException

If resolver is null.

Methods

| Improve this Doc View Source

GetDecoratedService(Type, Func<ICreatesAutofacDecorator, ICustomizesAutofacDecorator>, Parameter[])

Builds and returns an instance of a service, using the decorator pattern.

Declaration
public object GetDecoratedService(Type serviceType, Func<ICreatesAutofacDecorator, ICustomizesAutofacDecorator> customizationFunc, params Parameter[] globalParams)
Parameters
Type Name Description
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.

Autofac.Core.Parameter[] globalParams

An optional collection of resolution parameters, to be applied to every resolution operation.

Returns
Type Description
System.Object

The service instance.

| Improve this Doc View Source

GetDecoratedService<TService>(Func<ICreatesAutofacDecorator<TService>, ICustomizesAutofacDecorator<TService>>, Parameter[])

Builds and returns an instance of a service, using the decorator pattern.

Declaration
public TService GetDecoratedService<TService>(Func<ICreatesAutofacDecorator<TService>, ICustomizesAutofacDecorator<TService>> customizationFunc, params Parameter[] globalParams)
    where TService : class
Parameters
Type Name Description
System.Func<ICreatesAutofacDecorator<TService>, ICustomizesAutofacDecorator<TService>> customizationFunc

A customization function, to build the 'shape' of the decorated service.

Autofac.Core.Parameter[] globalParams

An optional collection of resolution parameters, to be applied to every resolution operation.

Returns
Type Description
TService

The service instance.

Type Parameters
Name Description
TService

The service type, typically an interface.

Implements

IGetsAutofacDecoratedService
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX