yang-er / efcore-ext

EFCore Extensions for batch-CRUD / cache / minor fix
MIT License
32 stars 6 forks source link

Predicate Error after Null Semantic Optimize #7

Open yang-er opened 3 years ago

yang-er commented 3 years ago
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 commented 3 years ago

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.