Metalama 1.0 / / Metalama Documentation / Extensions API / Metalama.​Extensions.​Dependency­Injection.​Implementation / Default­Pull­Strategy

Class DefaultPullStrategy

The default implementation of IPullStrategy.

Inheritance
DefaultPullStrategy
Implements
IPullStrategy
Namespace: Metalama.Extensions.DependencyInjection.Implementation
Assembly: Metalama.Extensions.DependencyInjection.dll
Syntax
public class DefaultPullStrategy : Object, IPullStrategy

Constructors

Name Description
DefaultPullStrategy(DependencyContext, IFieldOrProperty)

Initializes a new instance of the DefaultPullStrategy class.

Properties

Name Description
AssignedFieldOrProperty

Gets the field or property that must be assigned by the GetAssignmentStatement(IParameter) method.

Context

Gets the IntroduceDependencyContext.

IntroducedFieldOrProperty

Gets the dependency field or property in the target type.

ParameterType

Gets the type of the constructor parameter. This is used by both GetNewParameter(IConstructor) and GetExistingParameter(IConstructor).

Methods

Name Description
CleanParameterName(String)

Normalizes the name of the parameter by applying naming conventions.

GetAssignmentStatement(IParameter)

Gets a statement that assigns the dependency field or property from a parameter or another expression.

GetExistingParameter(IConstructor)

Gets a parameter from which the dependency can be initialized, or null if a new parameter must be created.

GetNewParameter(IConstructor)

Gets the specifications from which a constructor parameter can be constructed. This method is called when GetExistingParameter(IConstructor) returns null.

GetNewParameterName(IConstructor)

Gets the name of the new constructor parameter.

PullParameter(IParameter, IConstructor)

Returns a PullAction that instructs how a given constructor parameter should be pulled from another constructor.