efcore-ext icon indicating copy to clipboard operation
efcore-ext copied to clipboard

Predicate Error after Null Semantic Optimize

Open yang-er opened this issue 3 years ago • 1 comments

entityBuilder.Property(e => e.NonNullProperty).IsRequired();

string someNull = null;
context.Entities.Where(e => e.NonNullProperty == someNull).BatchUpdateAsync(e => new Entity { ... });

This may lead to the predicate section translated as a boolean.

yang-er avatar Apr 28 '21 12:04 yang-er

Seems that this is impacted by Microsoft.EntityFrameworkCore.Query.Internal.ParameterValueBasedSelectExpressionOptimizer+ParameterNullabilityBasedSqlExpressionOptimizingExpressionVisitor.

Only impacted target is EFCore.SqlServer 3.1.

This is hard to fix. Will add a test only and wait for other helps.

yang-er avatar May 07 '21 09:05 yang-er