title: Order of items after using LINQ Select extension method
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/204505/preserving-order-with-linq">Preserving order with LINQ</a>  </p>
  </blockquote>
  
  
  
  <p>Supposing I have the following <code>Person</code> class that is further used to declare an array of <code>Person</code>:</p>
  
  <pre><code>public class Person
  {
      public int Id { get;set; }
      public string Name { get; set; }
      public int Age { get; set; }
  }
  
  var persons = new[] {
      new Person { Id = 1, Name = "John", Age = 40 },
      new Person { Id = 2, Name = "John", Age = 30 },
      new Person { Id = 3, Name = "John", Age = 35 },
  };
  </code></pre>
  
  <p>I extract the <code>Age</code> from the array of <code>Person</code>, using the following LINQ <code>Select</code> extension method, </p>
  
  <pre><code>var ages = persons.Select(p =&gt; p.Age).ToArray;
  </code></pre>
  
  <p>Does LINQ guarantee that the order of the items in the derived array matches the order of the items in the source array such that the <code>ages</code> array would be in the following order?</p>
  
  <pre><code>40
  30
  35
  </code></pre>