You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix to #21006 - Support a default value for non-nullable properties
Only for scalar properties when projecting Json-mapped entity.
Only need to change code for Cosmos - relational already works in the desired way after the change to streaming (properties that are not encountered maintain their default value)
We still throw exception if JSON contains explicit null where non-nullable scalar is expected.
Fixes#21006
Copy file name to clipboardExpand all lines: src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.CosmosProjectionBindingRemovingExpressionVisitorBase.cs
// special case keys - we check them for null to see if the entity needs to be materialized, so we want to keep the null, rather than non-nullable default
725
+
// returning defaults is supposed to help with evolving the schema - so this doesn't concern keys anyway (they shouldn't evolve)
0 commit comments