title: Convert LINQ to expression tree
body: <p>I would like to dynamically create a LINQ statement including a where statement that has to be extended depending on the items in the pages list:</p>
  
  <pre><code>private IQueryable&lt;WS_WebShopTreeNode&gt; GetRootNodes(List&lt;ShopTreePage&gt; pages, IQueryable&lt;WS_WebShopTreeNode&gt; node_src)
  {
   var rootNodes = from tn in node_src
                          where tn.id_WebShopTreeNode_AsParent == null &amp;&amp;
                                tn.PageNo == 1 &amp;&amp; 
                                tn.PageNo == 2 &amp;&amp;
                                tn.PageNo == 3 &amp;&amp;
                                //etc.
                          select tn;
  }
  </code></pre>
  
  <p><code>ShopTreePage</code> is just an enum: </p>
  
  <pre><code>public enum ShopTreePage : byte
  {
      Unassigned = 0,
      UserRole = 1,
      Hardware = 2,
      Software = 3,
      Zubehoer = 4,
      All = 5
  }
  </code></pre>
  
  <p>I know that this can be achieved via expression trees. Unfortunately, I lack of knowledge about building expression trees.</p>