title: Entity Framework Code First IQueryable
body: <p>I am using Entity Framework Code First and ran into a small road block.  I have a class "Person" defined as such:</p>
  
  <pre><code>public class Person
  {
      public Guid Id { get; set; }
      public virtual ICollection&lt;History&gt; History { get; set; }
  }
  </code></pre>
  
  <p>and a class "History" defined as such:</p>
  
  <pre><code>public class History
  {
      public Guid Id { get; set; }
      public virtual Person Owner { get; set; }
      public DateTime OnDate { get; set; }
  }
  </code></pre>
  
  <p>However, when I call:</p>
  
  <pre><code>IEnumerable&lt;History&gt; results = person.History
                                 .OrderBy(h =&gt; h.OnDate)
                                 .Take(50)
                                 .ToArray();
  </code></pre>
  
  <p>It appears to pull all of the history for the person, then order it and such in memory.  Any recommendations on what I'm missing?</p>
  
  <p>Thanks in advance!</p>