Thursday, May 21, 2009 5:59 AMIn the blog post below, the item c states that orderby preservation is kept. From what i remember, it was encouraged to have the order by as the last operation in cases like using ofType, nested from clauses cuz it was getitng lost. So can someone explain what exactly has been improved in this area?
Friday, May 22, 2009 7:32 AMModerator
The way it basically works is that we recognize a number of patterns, the simplest of which is OrderBy(s)->Filter(p) and we lift the OrderBy, so the sample pattern is transformed into Filter(p)->OrderBy(s). The effect is that the OrderBy seems to be preserved even when other operations are applied on top.
- This change was implemented *after* beta 1.
- There are still cases in which lifting the OrderBy is not possible or not practical.
- The change in behavior only affects LINQ to Entities, and not EntitySQL. In ESQL the contract continues to be that OrderBy only affects the next operation and that if the next operation ignores the OrderBy, the OrderBy is lost.
- You will see that in many cases it is no longer necessary to lift the OrderBy yourself, or to make the OrderBy the last operation immediatelly before paging operations.
Hope this answers your question,
This posting is provided "AS IS" with no warranties, and confers no rights.
- Marked As Answer by Diego B VegaMicrosoft Employee, Moderator Friday, May 22, 2009 7:45 AM
Friday, May 22, 2009 7:40 PMThanks for your explanation.