Skip to content

How to update express with CalculationEngine #112

@dboydboy

Description

@dboydboy

I used CalculationEngine to manage and calculate a group of express,like as:

var engine = new CalculationEngine();
var context = new ExpressionContext();
engine.Add("x", "2", context);
engine.Add("y", "sqrt(x)", context);
engine.Add("z", "y * 3", context);

And i want to update the "x", and it could update the referenced express auto...
I tried the following:

engine.Remove("x");
engine.Add("x", "9", context);
engine.GetResult("y")

there is a exception like as:
System.ArgumentException:“No expression is associated with the name 'y'”
So, How could i update the "x"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions