Show / Hide Table of Contents

Class DecoratedServiceFactory

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

Inheritance
System.Object
DecoratedServiceFactory
Implements
IGetsDecoratedService
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.Common.dll
Syntax
public class DecoratedServiceFactory : IGetsDecoratedService

Constructors

| Improve this Doc View Source

DecoratedServiceFactory(IGetsDecoratedServiceFromResolutionInfo)

Initialises a new instance of DecoratedServiceFactory.

Declaration
public DecoratedServiceFactory(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<ICreatesDecorator, ICustomizesDecorator>, ITypedResolvable[])

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

Declaration
public object GetDecoratedService(Type serviceType, Func<ICreatesDecorator, ICustomizesDecorator> customizationFunc, params ITypedResolvable[] globalParams)
Parameters
Type Name Description
System.Type serviceType

The service type, typically an interface.

System.Func<ICreatesDecorator, ICustomizesDecorator> customizationFunc

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

ITypedResolvable[] 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<ICreatesDecorator<TService>, ICustomizesDecorator<TService>>, ITypedResolvable[])

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

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

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

ITypedResolvable[] 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

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