title: How to use the parenthesis in the expression tree
body: <p>[question]
  Could you tell me how to create the appropriate expression tree?</p>
  
  <p>[detail]
  I created following query statically, and result is as expected. </p>
  
  <pre><code>// Datasource
      string[] dataSource = { "John", "Ken", "Mark", "Mary", "Tom" };
  
  // Keyword for Search
      string[] keywords = { "o", "Mark", "Tom" };
  
  
      //LINQ Query (Static)
      var query = dataSource.AsQueryable().
      Where(item =&gt;
     (item.ToLower().Contains(keywords[0].ToLower()) ||
     item.ToLower().Contains(keywords[1].ToLower())) &amp;&amp;
     item.ToLower().Contains(keywords[2].ToLower())).
      OrderByDescending(item =&gt; item);
  
  
  //Result
  // "Tom"
  </code></pre>
  
  <p>condition A || condition B &amp;&amp; condition C</p>
  
  <p>but I do not know how to code the following condition with expression tree</p>
  
  <p>(condition A || condition B) &amp;&amp; condition C</p>
  
  <p>Does anyone tell me how to use the parethesis in the expression tree?
  So far what I created the body for lambda expression is as follows which does not work well.</p>
  
  <pre><code>public static Expression GetContainsExpression(Expression parameter, string keyword, Expression curBody)
  {
  
      var keywordValue = Expression.Constant(keyword, typeof(string));
        var newBody =
        Expression.Equal( Expression.Call(parameter, ToLower), Expression.Call(keywordValue, ToLower) );
  
      ///Connect curBody Expression and newBody Expression with "Or" e.s. ||   
      if (curBody != null)
      {
          if (keyword == "Tom")
          {
              return Expression.AndAlso(curBody, newBody);
          }
  
          else
          return Expression.OrElse(curBody, newBody);
      }
      return newBody;
  }
  </code></pre>