title: ToArray() in C# changing the order of the items in the list
body: <p>I am saving a set of data in the Database. FOr ex: </p>
  
  <p>Data on the database</p>
  
  <pre><code>ID  name     value
  0   param1    1
  0   param2    2
  0   param3    3
  0   param4    4
  0   param5    5
  0   param6    6
  0   param7    7
  0   param8    8
  1   param1    1
  1   param2    2
  0   param9    9
  0   param10    10
  1   param3    3
  1   param4    4
  </code></pre>
  
  <p>I query for selecting the rows with ID == 0, I get 10 data set rows in response. List myCollection is created and updated after looping through rows.
  The expected list would be </p>
  
  <pre><code>param1
  param2
  param3
  param4
  param5
  param6
  param7
  param8
  param9
  param10
  </code></pre>
  
  <p>After that to update one more structure, I am doing myCollection.ToArray()<br>
  But I am getting </p>
  
  <pre><code>param9
  param10
  param1
  param2
  param3
  param4
  param5
  param6
  param7
  param8
  </code></pre>
  
  <p>I dont know where the problem is happening. Since I am not able reproduce the issue.  I have added instrumentation for now. ANy help would be great to know where the problem is happening whether in the data retrieval from database or in ToArray()</p>
  
  <p>Thanks</p>