title: C# Dynamic Linq Variable Where clause
body: <p>I am following Scott Gu's article to create a dynamic LINQ 
  <a href="http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx">http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx</a></p>
  
  <p>He has given an example:</p>
  
  <pre><code>Expression&lt;Func&lt;Customer, bool&gt;&gt; e1 = 
      DynamicExpression.ParseLambda&lt;Customer, bool&gt;("City = \"London\"");  
  Expression&lt;Func&lt;Customer, bool&gt;&gt; e2 =
      DynamicExpression.ParseLambda&lt;Customer, bool&gt;("Orders.Count &gt;= 10");  
  IQueryable&lt;Customer&gt; query =
      db.Customers.Where("@0(it) and @1(it)", e1, e2);  
  </code></pre>
  
  <p>This works fine in my case. However I have unknown number of where clauses, which is decided at runtime.</p>
  
  <p>Can anyone please tell me how to create a generic Where clause, such as</p>
  
  <pre><code>Where("@0(it) and @1(it) and... @n(it)", e1, e2, ... en);
  </code></pre>
  
  <p>Thanks  </p>