dotnet / efcore

EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations.
https://docs.microsoft.com/ef/
MIT License
13.8k stars 3.2k forks source link

Fix to #34293 - Json: error when trying to materialize json entity with nullable property that is null in the json string - should materialize the property as null instead #35040

Closed maumar closed 2 weeks ago

maumar commented 2 weeks ago

Problem was that when computing nullability of a JSON entity we were using faulty logic - checking if the foreign key is required, rather than if its required dependent. This leads to optional entities being incorrectly marked as required and cause validation error when JSON contained null.

Fixes #34293