title: Linq Multiple Joins and Group By
body: <p>So I'm not even sure if what i'm doing is possible, but i'm basically trying to take 4 different lists, join them into 1 object.</p>
  
  <p>The only thing is, the <code>orderLineItems</code> will be a collection and I can't quite figure out the best way to get it into the appropriate list item. I know i probably need to do a group by, but the group by seems to break the assignments when i do the Select</p>
  
  <p><strong>One thing to clarify:</strong> The challenge is getting the LineItems - if I do not assign the line items and remove any lineitem reference from the query the data populates properly, however, since the lineitems are a collection I can't figure out the proper way to assign them in the Select - hope that makes sense..</p>
  
  <pre><code>var ordersa = (from order1 in orderList
    join person in customerAccountPeople
         on order1.CustomerAccountPersonId equals person.CustomerAccountPersonId
    join subject in subjectList
         on order1.SubjectId equals subject.SubjectId
    from orderLineItem in orderLineItemList
    join order in orderList
         on orderLineItem.OrderId equals order.OrderId
    group orderLineItem by orderLineItem.OrderId into orderLineItems
    select new OrderList()
    {
        Customer = person,
        Subject = subject,
        Order = order1,
        LineItems = orderLineItems
    }).ToList();
  </code></pre>