efcore
efcore copied to clipboard
EFCore 5.0.7 HasQueryFilter not translating to the same query as EF Core 3.1.8
The following difference in behavior is causing the query to not match an index in our table, causing performance issues.
option.HasQueryFilter(user => EF.Property<bool>(user, nameof(ApplicationUser.IsDeleted)) == false);
EFCore 3.1.8 output
[a].[IsDeleted] = CAST(0 AS bit)
EFCore 5.0.7
[a].[IsDeleted] <> CAST(1 AS bit)
EF Core version: 5.0.7 Database provider: Microsoft.EntityFrameworkCore.SqlServer Target framework: .NET 5.0 Operating system: Windows IDE: Visual Studio 2019
Looks like this is a duplicate of https://github.com/dotnet/efcore/issues/23472, closing.