I am trying to use an operator which is selected from an array in an if statement. As the code is below I cannot compile it. Is there anyway around this ?
string[] operators = new string[]{"<",">","=","!="};
decimal value = Convert.ToDecimal(values[j]);
var operator1 = (operators[Convert.ToInt32(IQueryTypeList[k])]);
int jjj = Convert.ToInt32(NTestValueList[k]);
if (value operator1 jjj)
{
IsActive = true;
}
else
{
IsActive = false;
}