title: Why Standard Extension Method on IEnumerables
body: <p>When i use a standard <strong>Extension Method</strong> on a <strong>List</strong> such as
  <strong>Where</strong>(...) </p>
  
  <p>the result is always <strong>IEnumerable</strong>, and when
  you decide to do a list operation such as <strong>Foreach()</strong></p>
  
  <p>we need to <strong>Cast</strong>(not pretty) or use a <strong>ToList()</strong> extension method that</p>
  
  <p>(maybe) uses a new List that consumes more memory (is that right?):</p>
  
  <pre><code>List&lt;string&gt; myList=new List&lt;string&gt;(){//some data};
  </code></pre>
  
  <p>(<strong>Edit</strong>: this cast on't Work)</p>
  
  <pre><code>myList.Where(p=&gt;p.Length&gt;5).Tolist().Foreach(...);
  </code></pre>
  
  <p>or</p>
  
  <pre><code>(myList.Where(p=&gt;p.Length&gt;5) as List&lt;string&gt;).Foreach(...);
  </code></pre>
  
  <p>Which is better code or is there a third way?</p>
  
  <p><strong>Edit:</strong>
  Foreach is a sample, Replace that with BinarySerach</p>
  
  <pre><code>myList.Where(p=&gt;p.Length&gt;5).Tolist().Binarysearch(...)
  </code></pre>