title: OrderBy and List vs. IOrderedEnumerable
body: <p>I ran across an unexpected problem with the following code.</p>
  
  <pre><code>List&lt;string&gt; items = new List&lt;string&gt;();
  items = items.OrderBy(item =&gt; item);
  </code></pre>
  
  <p>This code generates the error:</p>
  
  <blockquote>
    <p>Cannot implicitly convert type 'System.Linq.IOrderedEnumerable' to 'System.Collections.Generic.List'. An explicit conversion exists (are you missing a cast?)</p>
  </blockquote>
  
  <p>It appears I can change <code>items</code> to be of type <code>IEnumerable&lt;string&gt;</code> and the error goes away. But I need to be able to add items to the list, which <code>IEnumerable</code> doesn't support.</p>
  
  <p>Can someone help me understand this error, and what the easiest fix is? Is it safe to simply cast the result?</p>