title: Why use .AsEnumerable() rather than casting to IEnumerable<T>?
body: <p>One of the extension methods on <code>IEnumerable&lt;T&gt;</code> is <code>.AsEnumerable()</code>. This method converts the enumerable object it was called on into an instance of <code>IEnumerable&lt;T&gt;</code>. However, since an object must implement <code>IEnumerable&lt;T&gt;</code> in order to apply to this extension method, converting to <code>IEnumerable&lt;T&gt;</code> is a simple matter of casting to <code>IEnumerable&lt;T&gt;</code>. My question is why does this method exist at all?</p>
  
  <p>Example:</p>
  
  <pre><code>List&lt;string&gt; strings = new List&lt;string&gt;() { "test", "test2", "test3" };
  IEnumerable&lt;string&gt; stringsEnum1 = strings.AsEnumerable();
  IEnumerable&lt;string&gt; stringsEnum2 = (IEnumerable&lt;string&gt;)strings;
  </code></pre>
  
  <p>In the example above, <code>stringsEnum1</code> and <code>stringsEnum2</code> are equivalent. What's the point of the extension method?</p>
  
  <p><strong>Edit</strong>: As a corollary, why is there an <code>.AsQueryable()</code> method when casting to <code>IQueryable&lt;T&gt;</code> is equivalent?</p>