title: How to use OrderBy in Linq
body: <p>I am using OrderBy, and I have figured out that I have to use OrderBy as a last method, or it will not work.  Distinct operator does not grant that it will maintain the original order of values, or if I use Include, it cannot sort the children collection.</p>
  
  <p>Is there any reason why I shouldn't do Orderby always last and don't worry if order is preserved?</p>
  
  <p>Edit: 
  In general, is there any reason, like performance impact, why I should not use OrderBy last. Doesnt metter if I use EnityFramework to query a database or just querying some collection.</p>
  
  <pre><code>dbContext.EntityFramework.Distinct().OrderBy(o=&gt; o.Something); // this will give me ordered result 
  
  dbContext.EntityFramework.OrderBy(o=&gt; o.Something).Distinct().; // this will not, because Distinct doesnt preserve order.
  </code></pre>
  
  <p>Lets say that I want to Select only one property. </p>
  
  <pre><code>dbContext.EntityFramework.Select(o=&gt; o.Selected).OrderBy(o=&gt; o.Something);
  </code></pre>
  
  <p>Will order be faster if I order collection after one property selection? So in that case I should use Order last. And I am just asking is there any situation where ordering shoudnt be done as last command?</p>