Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ExpressionEvaluator.cs
1using System.Threading.Tasks;
2using Waher.Script;
4
6{
11 {
12 private Expression expression;
13 private ObjectProperties variables;
14
19 {
20 }
21
27 public Task Prepare(string Definition)
28 {
29 this.expression = new Expression(Definition);
30 return Task.CompletedTask;
31 }
32
38 public Task<object> Evaluate(object Instance)
39 {
40 if (this.variables is null)
41 this.variables = new ObjectProperties(Instance, new Variables());
42 else
43 this.variables.Object = Instance;
44
45 return this.expression.EvaluateAsync(this.variables);
46 }
47 }
48}
Evaluates property values where properties are defined as script expressions.
ExpressionEvaluator()
Evaluates property values where properties are defined as script expressions.
Task< object > Evaluate(object Instance)
Evaluates the parsed definition, on an object instance.
Task Prepare(string Definition)
Parses a property definition.
Class managing a script expression.
Definition: Expression.cs:39
async Task< object > EvaluateAsync(Variables Variables)
Evaluates the expression, using the variables provided in the Variables collection....
Definition: Expression.cs:4275
Collection of variables.
Definition: Variables.cs:25