title: Building a dynamic select using linq expressions
body: <p>I am trying to build a dynamic linq select using expressions.</p>
  
  <p>In other words, I would like to build a lambda query like:</p>
  
  <pre><code>class User {
   public string UserName {get; set;}
   public List&lt;Group&gt; Groups {get; set;}
  }
  
  class Group {
   public string GroupName {get; set;}
   .....
   ..... lots of other members
  }
  
  var = context.Set&lt;User&gt;().Select(u=&gt;new {UN = u.UserName, Groups = u.Groups.Select(g =&gt; g.GroupName)});
  </code></pre>
  
  <p>I tried using linq.expressions and was able to build a lambda like:</p>
  
  <p>u => new TypeName { UN = u.UserName }</p>
  
  <p>But could not find a way to create the same query using an anonymous type not handling a subquery for the Groups List property.</p>