title: LINQ with group by for nested list
body: <p>I am trying to filter and get a list if my main object using Linq with my nested lists.
  what I require is - <code>List&lt;Category&gt;</code></p>
  
  <pre><code>class Category contains List&lt;Order&gt; and List&lt;Price&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/RZH0q.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RZH0q.jpg" alt="enter image description here"></a></p>
  
  <p>But the result i get is grouped by both the child objects, hence i dont get the exact result. I want to group this seperatly to get the result. Below is my Linq query, </p>
  
  <p>What am I doing wrong here?</p>
  
  <pre><code>var resultList = (
      from category in Connection.Table&lt;Category&gt;().ToList()
      join order in Connection.Table&lt;Order&gt;().ToList()
          on category.Id equals order.CategoryId
      join price in Connection.Table&lt;Price&gt;().ToList()
          on category.Id equals price.CategoryId
      where category.Id == TestID
      select new {
          category.ID,
          category.Name,
          order,
          price
      } into grou
      group grou by new {
          grou.Id
      } into grp
      select new Category {
          Id = grp.Id,
          Order = grp.Select(x =&gt; x.order).ToList(),
          Price = grp.Select(x =&gt; x.price).ToList()
      }).ToList();
  </code></pre>