Skip to content

Breaking change note: stored NULL JSON collections materialize as null for nullable collection properties - #5526

Draft
ajcvickers wants to merge 1 commit into
dotnet:mainfrom
ajcvickers:breaking-change-nullable-json-collections
Draft

ajcvickers wants to merge 1 commit into
dotnet:mainfrom
ajcvickers:breaking-change-nullable-json-collections

Conversation

@ajcvickers

Copy link
Copy Markdown
Contributor

Adds a breaking change note to the EF Core 12 breaking changes page for dotnet/efcore#39630 (fixes dotnet/efcore#33452).

For owned JSON collections whose CLR property is annotated nullable, a stored NULL is now materialized as null even when the property has an initializer, and changes between null and empty are tracked and saved. The note describes the opt-out (SetIsNullable(false) or removing the annotation).

Draft until dotnet/efcore#39630 merges. Like the other open breaking change PRs, this adds ef-core-12.0/breaking-changes.md, so whichever merges second needs a trivial merge of the page.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new EF Core 12.0 breaking-changes page is missing from entity-framework/toc.yml, so readers cannot discover it through the documentation navigation.

1 open issue
What changed in this PR

Adds an EF Core 12 breaking-change note documenting how nullable owned JSON collections now preserve the distinction between stored NULL and empty collections, including materialization, change tracking, opt-out, and compiled-model guidance.

Changes:

  • Documents old and new materialization and tracking behavior.
  • Explains mitigation with nullable annotations or SetIsNullable(false).
  • Includes related issue links and compiled-model regeneration guidance.
File Description
entity-framework/​core/​what-is-new/​ef-core-12.0/​breaking-changes.md Adds the EF Core 12 breaking-change documentation for nullable owned JSON collection properties.

Review effort: Lite

@@ -0,0 +1,71 @@
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot set an owned, nullable JSON collection from empty to null

2 participants