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

Equal Operator

Sep 10, 2013 at 5:00 PM
Hello Rupert

It looks a great library for Expression evaluator, i started to test it, i see that it works very well, but i have an issue with equal operator, my code is :

string strExpression = "myobjecttest.CountryDefaultId = 'PER' && myobjecttest.MerchantCode != '1077'";
        var v = MyObject;
        string parsestr = strExpression;
        var p = new CompiledExpression(parsestr);
        p.RegisterType("myobjecttest", v);
        var x = p.Eval();
operators "&&" and "!=" works fine, but the operator "=" doesn´t work, i get the following exception:

Parser error at position 31: Unexpected token '='

This exception is raised in the line : p.Parse();

I will apreciatte your help please.

Thanks in advantange.
Sep 27, 2013 at 10:47 AM
Hi. This is a long thread, but anyway, currently according to the code, on the file Parser.cs, the operator is == and not =. I believe that the docs are wrong.
Feb 1, 2014 at 10:05 AM
saamorim, thanks for pointing that out!