title: Store expression trees in database
body: <p>I need to store logic conditions in database. for example: <code>(condition1 || condition2) &amp;&amp; condition3</code> should be stored in database.</p>
  
  <p>I plan to design a table [<strong>ExpressionTree</strong>] to handle the structure:</p>
  
  <pre><code>Id
  condition
  combinationId
  nextId(FK-&gt;[Condition2Combination.Id])
  operator (AND, OR, null)
  </code></pre>
  
  <p>If (condition1 || condition2) &amp;&amp; condition3 in the table [ExpressionTree], the records should be:</p>
  
  <pre><code>Id  conditionId combinationId nextId  operator
  1  condition1   combination1  2       OR
  2  condition2   combination1  3       AND
  3  condition3   combination1  null    null
  </code></pre>
  
  <p>But the solution is not good, what’s your suggestion? Thanks!</p>