title: C# Entity Framework 4.1 Lambda Include - only select specific included values
body: <p>I'm doing a lambda select on EF4.1, including another related DBSet in my current statement.</p>
  
  <pre><code> return dbEntity.GameTypes.Include(a =&gt; a.Draws)
                             .Where(d =&gt; d.IsActive == true )
                             .ToList();
  </code></pre>
  
  <p>I've got two classes:</p>
  
  <pre><code>//simplified versions of the classes
  public class GameType
  {
   public Nullable&lt;bool&gt; IsActive { get; set; }
   public virtual ICollection&lt;Draw&gt; Draws { get; set; }
  }
  
  public class Draw
  {
   public int DrawID { get; set; }
   public int GameTypeID { get; set; }
   public System.DateTime DrawDate { get; set; }
  } 
  </code></pre>
  
  <p>But I only want the next upcoming draw for each GameType. Essentially I want to do something like</p>
  
  <pre><code> return dbEntity.GameTypes.Include(a =&gt; a.Draws.Where(aw =&gt; aw.DrawDate &gt; System.DateTime.Now)
                                                 .OrderBy(ao =&gt; ao.DrawDate)
                                                 .First())
                             .Where(d =&gt; d.IsActive == true )
                             .ToList();
  </code></pre>
  
  <p>But it gives me: </p>
  
  <blockquote>
    <p>The Include path expression must refer to a navigation property defined on the type. Use dottedpaths for reference navigation properties and the Select operator for collection navigation properties.</p>
  </blockquote>
  
  <p>Is something like this possible or would I need to filter the result afterwards? I'd then also like to order the total result by the latest Draw.DrawDate. If anyone could show me the proper way I'd be trully gratefull. </p>