title: Linq includes in nested group by query
body: <p>I have a relatively complex query below with a few nested group by queries. The problem is that I don't know how I can add includes to any of the group by queries. Is there a way to include subproperties in the sub group queries in EF6?</p>
  
  <pre><code>return db.PatientOrders
                  .Include(x =&gt; x.Patient) // this has no effect
                  .Where(x =&gt; !x.ProcessedOn.HasValue &amp;&amp; x.Patient.Home.PharmacyId == pharmacyID)
                  .GroupBy(x =&gt; x.Patient.Home)
                  .ToDictionary(x =&gt; x.Key, x =&gt; x
                              .ToList()
                              .GroupBy(y =&gt; y.Patient.Department)
                              .ToDictionary(y =&gt; y.Key, y =&gt; y
                                      .Include(x =&gt; x.OrderLines) // this does not compile
                                      .ToList()
                                      .GroupBy(z =&gt; z.Patient)
                                      .ToDictionary(z =&gt; z.Key, z =&gt; z.ToList(), new PatientEqualityComparer()), new HomeDepartmentEqualityComparer()), new HomeEqualityComparer());
  </code></pre>