OrderByDescending in Orchard CMS

Topics: Core, Customizing Orchard, General, Writing modules
Oct 1, 2014 at 8:35 AM
Edited Oct 1, 2014 at 8:37 AM
I have a issue with OrderByDescending in Orchard CMS

Example Data:
ID → Name → DomainId
1 → First → 2
2 → Join → 3
3 → Peter → 1
4 → Abert → 1
5 → saha → 2
with LinQ to SQL code here:
IQueryable().OrderByDescending(r=> r.DomainId == 2)

it returns the correct result !
ID → Name → DomainId
1 → First → 2
5 → saha → 2
2 → Join → 3
3 → Peter → 1
4 → Abert → 1
but with OrchardCMS
IContentQuery().OrderByDescending(r=> r.DomainId == 2)

it returns the incorrect result and it will order from large to small

ID → Name → DomainId
2 → Join → 3
1 → First → 2
5 → saha → 2
3 → Peter → 1
4 → Abert → 1
Why incorrect ? and how to fix
Please help me!

Link stackoverflow.com: http://stackoverflow.com/questions/26116407/orderbydescending-in-orchard-cms