efcore
efcore copied to clipboard
Added nullable property to Json mapped model resulting in errors instead of mapping non existing json property to null
File a bug
Please see #29219 for context. This issue is precisely described in the comment https://github.com/dotnet/efcore/issues/29219#issuecomment-1356886149 that was added and is related to #29219.
When a new nullable property is added to a model mapped as json, then querying on that should not error, but instead missing json values in the data should just map to null. According to #29219 looks like this was fixed for simple types (string, int, ..) but still does not work for complex types.
Include provider and version information
EF Core version: 7.0.0 Database provider: Microsoft.EntityFrameworkCore.SqlServer Target framework: .NET 7.0
/cc @maumar
When accessing sub-element within JsonElement in materialization code we use JsonElement.GetProperty. We should use the TryGetProperty instead
Note from triage: bring to Tactics for patching.
reopening for potential servicing
when will v7.0.5 be released?