Open sandboxFocus

Class PullStrategy

Provides factory methods for creating standard implementations of the IPullStrategy interface.

Inheritance
PullStrategy
Namespace: Metalama.Framework.Advising
Assembly: Metalama.Framework.dll
Syntax
public static class PullStrategy
Remarks

A pull strategy determines how an introduced constructor parameter's value is obtained in child constructors. This class provides common implementations that cover most scenarios. For custom behavior, implement IPullStrategy directly.

The pull strategy is invoked for each constructor that calls the constructor where the parameter was introduced, either through : base(...) or : this(...) syntax. The strategy returns a PullAction that specifies what value to pass for the introduced parameter.

Methods

Name Description
IntroduceParameterAndPull(string?, IType?, IExpression?)

Creates a pull strategy that introduces a new parameter in the child constructor and passes its value to the introduced parameter.

UseConstant(TypedConstant)

Creates a pull strategy that passes a constant value to the introduced parameter.

UseExpression(IExpression)

Creates a pull strategy that passes a static expression value to the introduced parameter.

See Also