title: Check if condition in string format in c#
body: <p>I am not sure weather its possible or not but I have to do it in my project somehow.
  I am getting one condition in string format like:</p>
  
  <pre><code>string condition = "(param1='69' OR param1='66' OR param1='21' OR param1='93') AND (param2='FL' OR param2='WA) AND (param3!='31' AND param3!='19')";
  </code></pre>
  
  <p>This condition I am getting from db and I have value of param1, param2 and param3 in my code. Now I have to check this condition in a if statement weather its true of false and show result accordingly.</p>
  
  <p>I try like replacing param1, param2, param3 with actual value lets say 69, CA, 22. So the string will look like:</p>
  
  <pre><code>condition = "(69='69' OR 69='66' OR 69='21' OR 69='93') AND (CA='FL' OR CA='WA) AND (22!='31' AND 22!='19')";
  </code></pre>
  
  <p>and try to convert it in bool also but its not working.</p>
  
  <p>Please let me know if there is any way or else I need to hardcode it?
  One more thing, condition might very, like sometimes it will come with 2 variable or sometimes with four.</p>