title: Why to Apply AsEnumerable() Method to an Array?
body: <p>I am reading <a href="http://www.dotnetperls.com/asenumerable" rel="nofollow">C# AsEnumerable</a>:  </p>
  
  <blockquote>
    <p>"The IEnumerable interface is a generic interface. This means it
    defines a template that types can implement for looping. The
    AsEnumerable method, a generic method, allows you to cast a specific
    type to its IEnumerable equivalent"</p>
  </blockquote>
  
  <p>Further on, a code example:  </p>
  
  <pre><code>using System;
  using System.Linq;
  
  class Program
  {
     static void Main()
     {
         // Create an array type.
          int[] array = new int[2];
          array[0] = 5;
          array[1] = 6;
          // Call AsEnumerable method.
          var query = array.AsEnumerable();
          foreach (var element in query)
          {
              Console.WriteLine(element);
          }
      }
  }
  </code></pre>
  
  <p>Sounds like I need to convert an array to an <strong>IEnumerable</strong> type object to use looping (<strong>foreach</strong>?).    </p>
  
  <p>But applying <strong>foreach</strong> directly to an <strong>array</strong> yields exactly the same results:  </p>
  
  <pre><code>using System;
  //using System.Linq;
  
  class Program
  {
      static void Main()
      {
          // Create an array type.
          int[] array = new int[2];
          array[0] = 5;
          array[1] = 6;
          // Call AsEnumerable method.
          //var query = array.AsEnumerable();
          foreach (var element in array)
          {
              Console.WriteLine(element);
          }
      }
  }
  </code></pre>
  
  <p>So, the entire webpage with an explanation of <strong>AsEnumerable()</strong> method is void for me.<br>
  What did I miss?  </p>