Metalama 1.0 / / Metalama Documentation / Aspect API Documentation / Metalama.​Framework.​Dependency­Injection.​Implementation / Default­Dependency­Injection­Strategy

Class DefaultDependencyInjectionStrategy

The default implementation of the IntroduceDependency(IntroduceDependencyContext, IAspectBuilder<INamedType>) interface method. It is designed to be easily extended and overwritten.

Inheritance
DefaultDependencyInjectionStrategy
Namespace: Metalama.Framework.DependencyInjection.Implementation
Assembly: Metalama.Framework.DependencyInjection.dll
Syntax
[CompileTime]
public class DefaultDependencyInjectionStrategy : Object

Constructors

Name Description
DefaultDependencyInjectionStrategy(DependencyContext)

Initializes a new instance of the DefaultDependencyInjectionStrategy class.

Properties

Name Description
Context

Gets the IntroduceDependencyContext for which the current object was created.

Methods

Name Description
GetConstructors(INamedType)

Gets the constructors that are modified by PullDependency(IAspectBuilder<INamedType>, IPullStrategy).

GetPullStrategy(IFieldOrProperty)

Gets an IPullStrategy, i.e. a strategy to pull a dependency field or property from constructors.

ImplementDependency(IAspectBuilder<IFieldOrProperty>)
IntroduceDependency(IAspectBuilder<INamedType>)

The entry point of the DefaultDependencyInjectionStrategy. Orchestrates all steps: first calls TryIntroduceFieldOrProperty(IAspectBuilder<INamedType>, out IFieldOrProperty), then GetPullStrategy(IFieldOrProperty), then PullDependency(IAspectBuilder<INamedType>, IPullStrategy).

PullDependency(IAspectBuilder<INamedType>, IPullStrategy)

Pulls the dependency from all constructors, i.e. introduce a parameter to these constructors (according to an IPullStrategy), and assigns its value to the dependency property.

PullDependency(IAspectBuilder<INamedType>, IPullStrategy, IConstructor)

Pulls the dependency from a given constructor.

TryIntroduceFieldOrProperty(IAspectBuilder<INamedType>, out IFieldOrProperty)

Introduces the field or property into the target class.

Extension Methods

PresentingExtensions.AsHyperlink(Object)