title: Using Group in LINQ Query
body: <p>I am using the LINQ to CRM provider. </p>
  
  <p>I am querying the information then I am using LINQ to query the LINQ to CRM query so I can use GroupBy, since the LINQ to CRM provider does not support it. This is what I have so far.</p>
  
  <pre><code>var linqQuery = (from r in orgServiceContext.CreateQuery("opportunity")
      join c in orgServiceContext.CreateQuery("contact") on 
          ((EntityReference)r["new_contact"]).Id equals c["contactid"] into opp
      from o in opp.DefaultIfEmpty()
      select new
      {
          OpportunityId = !r.Contains("opportunityid") 
              ? string.Empty : r["opportunityid"],
          CustomerId = !r.Contains("customerid") 
              ? string.Empty : ((EntityReference)r["customerid"]).Name,
          OwnerId = !r.Contains("ownerid") 
              ? string.Empty : ((EntityReference)r["ownerid"]).Id.ToString(),
          OwnerName = !r.Contains("ownerid") 
              ? string.Empty : ((EntityReference)r["ownerid"]).Name.ToString(),
          Priority = !r.Contains("opportunityratingcode") 
              ? string.Empty : r.FormattedValues["opportunityratingcode"],
          ContactName = !r.Contains("new_contact") 
              ? string.Empty : ((EntityReference)r["new_contact"]).Name,
          // ...
          // other properties  
      });
  
  var linqQuery2 = (from f in linqQuery.ToList()
                    group f by f.OwnerId into myGroup
                    select new
                    {
                        OrderCount = myGroup.Count()
                    });
  </code></pre>
  
  <p>But I also want to be able to query the other variables that are in <code>linqQuery</code> from <code>linqQuery2</code>.</p>
  
  <p>So I would want something like:</p>
  
  <pre><code>var linqQuery2 = (from f in linqQuery.ToList()
                    group f by f.OwnerId into myGroup
                    select new
                    {
                        OwnerName = myGroup.OwnerName,
                        OrderCount = myGroup.Count()
                    });
  </code></pre>
  
  <p>Is this possible to do?</p>