title: C# Linq IQueryable select flattened nested object list
body: <pre><code>public class Parent
  {
      public int ParentId { get; set; }
      public string ParentPropertyA { get; set; }
      public string ParentPropertyA { get; set; }
      public List&lt;Child&gt; Children{get; set;}
  
  }
  
  public class Child
  {
      public int ChildId { get; set; }
      public string ChildPropertyA { get; set; }
      public string ChildPropertyB { get; set; }
  }
  
  private static Expression&lt;Func&lt;Parent, dynamic&gt;&gt; BuildModel()
  {
      return x =&gt; new
      {
          x.ParentId,
          x.Children
      };
  }
  </code></pre>
  
  <p>I use this expression on <code>IQueryable.Select(BuildModel())</code></p>
  
  <p>Let's say I have a <code>Parent</code> object with two <code>Children</code>... 
  Given that structure how can I achieve returning two records with all <code>Parent</code> properties and with specific <code>Children</code>, instead of just one <code>Parent</code> with two <code>Children</code>?</p>
  
  <p>Example:</p>
  
  <pre><code>{
    ParentId: 1,
    ParentPropertyA: "parentA",
    ParentPropertyB: "parentB",
    Children:
    [
      {
        ChildId: 1,
        ChildPropertyA: "childA1",
        ChildPropertyB: "childB1"
      },
      {
        ChildId: 2,
        ChildPropertyA: "childA2",
        ChildPropertyB: "childB2"
      }
    ]
  }
  </code></pre>
  
  <p>Instead, I want to have them returned as:</p>
  
  <pre><code>[
    {
      ParentId: 1,
      ParentPropertyA: "parentA",
      ParentPropertyB: "parentB",
      ChildId: 1,
      ChildPropertyB: "childB1"
    },
    {
      ParentId: 1,
      ParentPropertyA: "parentA",
      ParentPropertyB: "parentB",
      ChildId: 2,
      ChildPropertyB: "childB2"
    }
  ]
  </code></pre>
  
  <p>Is this possible? Thanks!</p>