After upgrading my project from (dotnet core 2/ef core 2) to (dotnet core 3/ef core 3) almost all of my entity framework LINQ queries are broken. while I already read this i
use OrderByDesc()
for some property and then FirstAsync()
. (https://github.com/aspnet/EntityFrameworkCore/issues/18211)
the invariant compare is not translated, was probably client evaluated previously. Depending on your database collation setting you could probably just do a normal equals here.
Calling AsEnumerable()
on your DbSet
without any filters will pull down all data locally, not something you want to do in production. Try rewriting to above and monitor the generated SQL to ensure that you get performant queries.