Annotate the argument receiving the interpolated string handler with the attribute InterpolatedStringHandlerArgument, for example:
public void PrintMessage(
string color,
[InterpolatedStringHandlerArgument("", "color")]
ColorInterpolatedStringHandler builder
)
Remarks:
"" parameter refers to this in that context."color" parameter refers to the argument named color.
ctor(int literalLength, int formatCount, MyClass my, string color)Know more:
References: