OrderCondition

Nov 1, 2010 at 11:28 AM

Hello,
what about an OrderCondition similar FilterConditionto enumeration?
I know, the FieldAttribute has an FieldSearchOrder, but what if i need my results order in different directions?

Kind regards

svbirdy

Coordinator
Nov 1, 2010 at 2:14 PM

Why not use LINQ to just re-order the results?

Something along these lines:

users.OrderBy(u => u.Name);

or

users.OrderByDescending(u => u.Name);

Nov 2, 2010 at 9:45 AM

Wouldn't it be faster with an OrderCondition?

Coordinator
Nov 2, 2010 at 2:09 PM

It depends on the scenario, but in many cases it will be slower.  An OrderCondition outside of the FieldSearchOrder would mean that we have to fall back to SQL to use the ORDER BY clause.  Right now we rarely use SQL, but instead do direct table access, which is 10x faster.  Doing an ORDER BY might have the data ordered faster than LINQ (I'm not convinced that's true either, but let's say it is), the retrieval of the data is going to be substantially slower becasue we used the query processor to get the data in the right order.