Open sandboxFocus

Method UseExpression

UseExpression(IExpression)

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

Declaration
public static PullAction UseExpression(IExpression expression)
Parameters
Type Name Description
IExpression expression

The expression to use for pulling the dependency. Only static expressions are supported (e.g., constants, field access, static method calls).

Returns
Type Description
PullAction

A PullAction that uses the specified expression.

Remarks

This action allows you to pass a static expression to the introduced parameter. Use this for expressions that can be evaluated at compile-time and are static in nature, i.e. do not reference this.

Note: To forward an existing parameter from the child constructor, use UseExistingParameter(IParameter) instead, as it provides better readability and type safety.

See Also