I am generating a expression from some business rules and it might look like this
0 > 1
12 < 14
"abc" != "xyz"
90 >= 12
Now I have to do certain implementations based on that condition. For example:
string condition = "0 =1";
if(condition)
{
// do something because condition is passed
}
else
{
// do something because condition is failed
}
I have tried to do the same with the dynamic keyword but it is still not working. Any work around?
Edit : 1 modified code
string _initExp = "1";
string _validateCondition = "== 0";
string strcondition = _initExp + _validateCondition;
bool _condition = Convert.ToBoolean(strcondition); // Error statement
if (_condition)
{
}