1

Closed

OrderBy Clauses Shade Programmed Ones

description

The scenario is to return IQueryable as follows:

_dataContext
.Cards
.OrderByDescending(kc => kc.SendDate)
.Where(x => x.SendDate > someDate);

Framework inserts additional orderby clauses on the primary key to ensure a stable sort. The resulting query is as follows:

_dataContext
.Cards
.OrderByDescending(kc => kc.SendDate)
.Where(x => x.SendDate > someDate)
.Userqueries
.OrderBy(kc => kc.Id)

So, the first ordering is shaded.

Related discussion: http://aspnetwebstack.codeplex.com/discussions/391082 .
Closed Sep 24, 2012 at 10:30 PM by HongmeiG
We have a knob to disable this already.

comments