This project has moved and is read-only. For the latest updates, please go here.

Register Parameter - Example

Jul 14, 2015 at 12:11 PM

I can see a method RegisterParameter as part of TypeRegistry

Can you help me use it? In the following code, I want to parameterize the constant "OPEN", and pass it during the function call
        TypeRegistry reg = new TypeRegistry();
        reg.RegisterType("classA", typeof(ClassA));
        ExpressionEvaluator.CompiledExpression<bool> expr = new ExpressionEvaluator.CompiledExpression<bool>("Status == \"OPEN\"") { TypeRegistry = reg };
        var func = expr.ScopeCompile<ClassA>();
       //... and then
      for (int i = 0;i<list.Count;i++)
             ClassA abc = list[i];
             bool res=func(abc);
             //Here I want something like 
             //bool res = func(abc, "OPEN");