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

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -