tags:

views:

186

answers:

2

I already know that LINQ works by evaluating expressions and iterating one by one thru them (kinf of like a pipeline), however there are certain operations like OrderBy that need to be buffered since sorting needs to analize all the data at once to do the sort.

I am interested in knowing behind the scenes how is this data buffered in LINQ behind the scenes.

If anyone can point me to an article or explanation I would appreciate it.

Thanks

+2  A: 

It is up to the LINQ provider to implement. Some providers (e.g., LINQ to SQL, LINQ to Entities) will transliterate to a SQL OrderBy. Others (LINQ to Objects) will sort on the client. All LINQ really does itself is call a method named OrderBy or OrderByDesc.

Craig Stuntz