Open sandboxFocus

Struct PullAction

Represents a way to pull a constructor parameter value from child constructors when propagating introduced parameters.

Namespace: Metalama.Framework.Advising
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public readonly struct PullAction
Remarks

When a parameter is introduced to a constructor using IntroduceParameter(IAdviser<IConstructor>, string, IType, TypedConstant, IPullStrategy?, ImmutableArray<AttributeConstruction>), child constructors (those that call the modified constructor via : base(...) or : this(...)) need to provide a value for this new parameter. A PullAction specifies how to obtain that value.

Common scenarios:

Properties

Name Description
Expression

Gets the expression to use for pulling the dependency when UseExpression(IExpression) or UseConstant(TypedConstant) is used.

None

Gets a PullAction that means that the dependency has to be set to its default value.

Methods

Name Description
IntroduceParameterAndPull(string, IType, IExpression?, ImmutableArray<AttributeConstruction>)
UseConstant(TypedConstant)

Creates a PullAction that means that the dependency should be assigned to a given TypedConstant.

UseExistingParameter(IParameter)

Creates a PullAction that means that the dependency should be pulled from an existing constructor parameter.

UseExpression(IExpression)

Creates a PullAction that means that the dependency should be assigned to a given IExpression.

See Also