This project has moved. For the latest updates, please go here.

case-insensitive expressions

Sep 3, 2015 at 7:47 AM
I am using Expression Evaluator mainly to dynamically set/get values in fairly simple objects (sometimes invoke methods on them). So far it is working very well except when user tries to access some value in the object structure using invalid case for property/method.

var simpleObj = new SimpleClass { NativeStringParam = "textContent"};
var reference = "someob.nativestringparam";
var compiledExpression = new CompiledExpression<string>(reference) { 
  TypeRegistry = _typeRegistry 
            var result = compiledExpression.Eval();
The problem is that SimpleClass which is registered in the TypeRegistry has property NativeStringParam in camelcase but user attempts to access it in lowercase. In that case exception is thrown:
ExpressionEvaluator.Parser.ExpressionParseException: Cannot resolve member "nativeStringparam" on type "SimpleClass" at line 1 char 10
Changing the incoming expressions is not going to happen as this is a legacy application with a lot of such (lowercase) uses.

Is there some way I could achieve this with this product?