efcore: Access to context bound variable can incorrectly be optimized out
Found investigating #9809. This should work:
modelBuilder
.Entity<Report>()
.HasQueryFilter(x => !x.IsDeleted && (IsModerated == null || IsModerated == x.IsModerated));
but the IsModerated == null part is optimized away.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 18 (14 by maintainers)
Commits related to this issue
- [2.0.1] Query: Stop short-circuiting on context closure access Issue: We adopted short-circuiting logic in logical expression due to possible exceptions (which compiler would never throw in memory). T... — committed to dotnet/efcore by smitpatel 7 years ago
- [2.0.1] Query: Stop short-circuiting on context closure access Issue: We adopted short-circuiting logic in logical expression due to possible exceptions (which compiler would never throw in memory). T... — committed to dotnet/efcore by smitpatel 7 years ago
- Issue: We adopted short-circuiting logic in logical expression due to possible exceptions (which compiler would never throw in memory). This works correctly for general cases because the expression tr... — committed to dotnet/efcore by smitpatel 7 years ago
- [2.0.1] Query: Avoid short-circuiting while using context closure variables in query filters Issue: We adopted short-circuiting logic in logical expression due to possible exceptions (which compiler w... — committed to dotnet/efcore by smitpatel 7 years ago
- [2.0.1] Query: Stop short-circuiting on context closure access Issue: We adopted short-circuiting logic in logical expression due to possible exceptions (which compiler would never throw in memory). T... — committed to dotnet/efcore by smitpatel 7 years ago
- Fix #9825 - Access to context bound variable can be optimized out Replaced short-circuiting optimization in ParameterExtractingExpressionVisitor with cheap null compensation handling. The main advant... — committed to dotnet/efcore by anpete 7 years ago
- Fix #9825 - Access to context bound variable can be optimized out Replaced short-circuiting optimization in ParameterExtractingExpressionVisitor with cheap null compensation handling. The main advant... — committed to dotnet/efcore by anpete 7 years ago
- [2.0.1] Query: Fix for Access to context bound variable can be optimized out Issue: We adopted short-circuiting logic in logical expression due to possible exceptions (which compiler would never throw... — committed to dotnet/efcore by smitpatel 7 years ago
- [2.0.1] Query: Fix for Access to context bound variable can be optimized out Issue: We adopted short-circuiting logic in logical expression due to possible exceptions (which compiler would never throw... — committed to dotnet/efcore by smitpatel 7 years ago
- [2.0.1] Query: Fix for Access to context bound variable can be optimized out Issue: We adopted short-circuiting logic in logical expression due to possible exceptions (which compiler would never throw... — committed to dotnet/efcore by smitpatel 7 years ago
- [2.0.1] Query: Fix for Access to context bound variable can be optimized out Issue: We adopted short-circuiting logic in logical expression due to possible exceptions (which compiler would never throw... — committed to dotnet/efcore by smitpatel 7 years ago
- [2.0.1] Query: Fix for Access to context bound variable can be optimized out Issue: We adopted short-circuiting logic in logical expression due to possible exceptions (which compiler would never throw... — committed to dotnet/efcore by smitpatel 7 years ago
@antonio-campagnaro It was fixed in the NuGet package versioned 2.0.1, which is part of the ASP.NET meta-package 2.0.3.
So what release of EF Core resolve this issue?