title: LINQ to Entities -- OrderBy().ToList() vs. ToList().OrderBy()
body: <p>I'm looking for confirmation/clarification with these LINQ expressions:</p>
  <pre><code>var context = new SomeCustomDbContext()
  
  // LINQ to Entities?
  var items  = context.CustomItems.OrderBy(i =&gt; i.Property).ToList();
  
  // LINQ to Objects?
  var items2 = context.CustomItems.ToList().OrderBy(i =&gt; i.Property);
  </code></pre>
  <ol>
  <li><p>Am I correct in thinking the first method is <code>LINQ to Entities</code> where EF builds a more specific SQL statement to pass on, putting the ordering effort on on the database?</p>
  </li>
  <li><p>Is the second method <code>LINQ to Objects</code> where LINQ drags the whole collection into memory (the <code>ToList()</code> enumeration?) before ordering thus leaving the burden on the server side (the web server in this case)?</p>
  <p>If this is the case, I can quickly see situations where L2E would be advantageous (ex. filtering/trimming collections before pulling them into memory).</p>
  </li>
  <li><p>But are there any other details/trade-offs I should be aware of, or times when &quot;method 2&quot; might be advantageous over the first method?</p>
  </li>
  </ol>
  <p><strong>UPDATE:</strong></p>
  <p>Let's say we are not using EntityFramework, this is still true so long as the underlying repository/data source implements <code>IQueryable&lt;T&gt;</code> right? And if it doesn't both these statements result in <code>LINQ to Objects</code> operations in memory?</p>