I have IList<Gu> gu= Context.GuSet.OrderBy(gu=>gu.IsSth)
where IsSth
is a boolean
. I want that thoose with true are listed before. But it orders by Id consequently
Asked
Active
Viewed 62 times
0

thestruggleisreal
- 940
- 3
- 10
- 26
-
0 comes before 1, so if you want true before, you need `OrderByDescending` – Camilo Terevinto Jan 17 '19 at 13:56
-
yes also tried descending @CamiloTerevinto but the general problem is that it does not sort in any way – thestruggleisreal Jan 17 '19 at 13:57
-
Use the answer by @JonnyRaa in the duplicate. It's likely EF cannot translate that – Camilo Terevinto Jan 17 '19 at 13:58
-
does also not work :( – thestruggleisreal Jan 17 '19 at 14:08