Adding a Parameter in EvaluateParameter delegate

Topics: New Features
Feb 11, 2016 at 7:55 PM
Edited Mar 3, 2016 at 12:59 PM
Hi, is there any way I can do something like this:
expression.EvaluateParameter += delegate(string name, ParameterArgs args)
{
    // get hold of the parameter
    string myParam = "[Sub] * [Expression]";

    args.Result = new Expression(myParam);
}
I've also tried
expression.EvaluateParameter += delegate(string name, ParameterArgs args)
{
    // get hold of the parameter
    string myParam = "[Sub] * [Expression]";

    expression.Parameters.Add(name, new Expression(myParam));
}
Neither of those work. Can this be made possible?

At the moment I'm using a LogicalExpressionVisitor to check the expression to find all parameters needed in the calculation, and I then look these up and add them as parameters. The parameters are currently public properties on a plain object.