Is IOrderedQueryable.AsEnumerable() still ordered?

context.EntitySet.AsEnumerable().OrderBy() returns an IOrderedEnumerable which is guaranteed to be ordered but it looks like the sorting is done client side.

context.EntitySet.OrderBy().AsEnumerable() preserves the expression as an IOrderedQueryable until it finally becomes an IEnumerable. I believe the ordering is done by the database in this case which is preferable. In some basic tests the output appears to still be ordered. Is ordering guaranteed even though IOrderedQueryable.AsEnumerable() only returns an IEnumerable?

Answers


Yes, it is guaranteed. AsEnumerable is only a simple forward-only wrapper (and IOrderedEnumerable is only a marker interface in fact).


Need Your Help

Change WebService endpoint address at run time

java web-services netbeans

I used Netbeans to generate Web Sevice client code from WSDL url.

SWT/JFace databinding change background

eclipse data-binding swt jface nebula

I have to implement a change background behavior when validating using DataBinding, how do I do this ?