Click here to Skip to main content
15,904,346 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is the default order of a query lowest index to highest?

For example say I have a list of objects which every other item has a flag "Flag" set to false. I then query using LINQ objects that have the flag set to false.

Will I receive them the same order they were in the list (minus the once that did not meet the criteria)?
Posted

1 solution

This will depend on LINQ to "what" for the implementation.

For example, LINQ to SQL is implemented as dynamic, parameterized queries which return records in the same order as retrieved from the database (which is by index), so in that case your answer would be yes.

Of course, if you implemented your indexes with descending sort, it would be highest to low...

Cheers,
-jc
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900