I was testing Lambdaparser.eval() to handle user expression, where values are added to an expandoObject. This way I could create a dynamic object that contains properties which can be used in the expression. But it seems that expandoObjects and dynamic objects are not supported. Here is a snippet of my unit test with the ExpandoObject:
var lambdaParser = new LambdaParser();
var varContext = new Dictionary<string, object>();
dynamic dynamicDiplomas = new ExpandoObject();
dynamicDiplomas.ODB = true; /* this should come from a DB */
dynamicDiplomas.IDB = null;
varContext["diplomas"] = dynamicDiplomas;
expression = "diplomas.ODB || diplomas.IDB != null";
// MissingMemberException
Assert.Throws<System.Reflection.TargetInvocationException>(() => lambdaParser.Eval(expression, varContext));
I was testing Lambdaparser.eval() to handle user expression, where values are added to an expandoObject. This way I could create a dynamic object that contains properties which can be used in the expression. But it seems that expandoObjects and dynamic objects are not supported. Here is a snippet of my unit test with the ExpandoObject:
Is this a known limitation?