title: C# Convert IEnumerable to IList using .ToList()?
body: <p>I am using an external library thats returns a <code>IEnumerable</code>. After I have recieved them I would like to add some models to the end. That only seems possible when using an <code>IList</code> or some other collection. So when i'm trying to convert the <code>IEnumerable</code> to a list using the <code>.ToList()</code> method it returns an <code>IEnumerable</code>. That's not the what I expected? Am I using <code>.ToList()</code> correct? Or what else would solve my problem?</p>
  
  <p>This is my code i have so far:</p>
  
  <pre><code>IList&lt;Models.Browser.Language&gt; languages = GetLanguages(dateDrom, dateTo).ToList();
  IList&lt;Models.Browser.Language&gt; primaryItems = languages.Take(10);
  </code></pre>
  
  <p>This last line produces an error saying:
  <code>Cannot implicitly convert type 'System.Collections.Generic.IEnumerable&lt;Bogus.Models.Browser.Language&gt;' to 'System.Collections.Generic.IList&lt;Bogus.Models.Browser.Language&gt;'. An explicit conversion exists (are you missing a cast?)</code></p>
  
  <p>Thanks in advance!</p>