efcore icon indicating copy to clipboard operation
efcore copied to clipboard

EFCore 5.0.7 HasQueryFilter not translating to the same query as EF Core 3.1.8

Open uipathswapnil opened this issue 5 years ago • 1 comments

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

uipathswapnil avatar Sep 03 '21 17:09 uipathswapnil

Looks like this is a duplicate of https://github.com/dotnet/efcore/issues/23472, closing.

uipathswapnil avatar Sep 03 '21 17:09 uipathswapnil