I already know that LINQ works by evaluating expressions and iterating one by one through them (kind of like a pipeline), however there are certain operations like OrderBy
that need to be buffered since sorting needs to analyze all the data at once to do the sort.
I am interested in knowing how this data is buffered in LINQ behind the scenes.
If anyone can point me to an article or explanation I would appreciate it.
Thanks
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With