title: Linq/EF, Eager loading and GROUP BY issues
body: <p>I'm having issues with GROUP BY and eager loading. I try to explain what im doing. 
  I'm querying a datacontext ctx for events </p>
  
  <p>The event class has the following properties</p>
  
  <pre><code>string Description
  DateTime Date
  bool IsDeleted
  Guid SubjectId 
  string Title 
  DateTime Created
  Guid ForProjectId 
  
  Person TriggeredBy
  List&lt;Guid&gt; Targets 
  </code></pre>
  
  <p>There are muttiple events with the same SubjectId and i would like to end up having events with unique SubjectIds and that are the newest in the group. I end up with the following query. </p>
  
  <pre><code>var events = from x in
               (from e in ctx.Events
                .Include("TriggeredBy")
                .Include("Targets")
                group e by e.SubjectId
                into g
                select new 
                       { 
                         GroupId = g.Key, 
                         EventsWithSameSubjectId = g, 
                       }
                )
                select x.EventsWithSameSubjectId
                .OrderByDescending(y =&gt; y.Created).FirstOrDefault();
  </code></pre>
  
  <p>The query compile fine and returns the right resulting set. But the included properties are always null. </p>
  
  <p>When i strip the query to see if eagor loading is working properly....</p>
  
  <pre><code>var events =  (from e in ctx.Events.OfType&lt;DataNotificationEvent&gt;()
                .Include("TriggeredBy")
                .Include("Targets")
                select e).ToList();
  </code></pre>
  
  <p>This return the events with all the included properties.</p>
  
  <p>Is this a known issue / bug with Linq / EF or is there any way i can get rid of this error.</p>
  
  <p>Regards</p>
  
  <p>Vincent Ottens</p>