I am trying to get dynamic expresso to interpret this line of code:
(((IDictionary<string, object>)o)["Diesel % in oil"].ToString().StartsWith("<") ? ((IDictionary<string, object>)o)["Diesel % in oil"].ToString().Replace("<", String.Empty) : ((IDictionary<string, object>)o)["Diesel % in oil"].ToString())
When it executes I get the following exception Unknown identifier 'IDictionary' (at index 3).
I am testing for a "<" at the start and then replacing all instances of the "<" (excuse the terrible key name - out of my control that one!).
I have tried adding typeof(System.Collections.Generic.IDictionary<string, object>) as a reference to the interpreter object, but no joy.
The full code:
var interpreter = new Interpreter();
interpreter.Reference(typeof(System.Collections.Generic.IDictionary<string, object>));
interpreter.SetVariable("o", o);
return (T)interpreter.Eval(code);
I'm sure I'm missing something simple.
I am trying to get dynamic expresso to interpret this line of code:
When it executes I get the following exception Unknown identifier 'IDictionary' (at index 3).
I am testing for a "<" at the start and then replacing all instances of the "<" (excuse the terrible key name - out of my control that one!).
I have tried adding
typeof(System.Collections.Generic.IDictionary<string, object>)as a reference to the interpreter object, but no joy.The full code:
I'm sure I'm missing something simple.