C
C#2y ago
Dusty

EF Core + SQLite order by decimal value [Answered]

Hey I tried to sort a query via a decimal column but I get this exception: System.NotSupportedException: SQLite does not support expressions of type 'decimal' in ORDER BY clauses. Convert the values to a supported type, or use LINQ to Objects to order the results on the client side. I searched a bit an people were speaking about using custom collations. Sadly I haven't found anything else about this yet. I also tried client evaluation but this just takes too long as my table has several million entries :/ Any ideas on this?
3 Replies
Angius
Angius2y ago
https://github.com/dotnet/efcore/issues/18593 Seems you can add a conversion to double and that'll do the trick
Dusty
Dusty2y ago
Thanks that works!
Accord
Accord2y ago
✅ This post has been marked as answered!