c# - Will the result of a LINQ query always be guaranteed to be in the correct order? -


question: result of linq query guaranteed in correct order?

example:

int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };   var lownums =    n in numbers    n < 5    select n;  

now, when walk through entries of query result, in same order input data numbers ordered?

foreach (var x in lownums)    {      console.writeline(x);    }  

if can provide note on ordering in documentation, perfect.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -