Repository navigation
[release/11.0] Persist null complex properties on TPH siblings with shared columns - #39662
Merged
AndriySvyryd merged 5 commits intoNov 16, 2026
Merged
Conversation
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
AndriySvyryd
commented
Nov 15, 2026
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The update-pipeline ordering change is accompanied by regression coverage for affected and unaffected mappings and documentation of the shared-column invariant.
No open issues 🎉
What changed in this PR
Fixes persistence of nullable complex properties set to null when TPH sibling types share columns. The update pipeline now identifies the column writer before skipping propagation into null complex properties, with regression coverage for affected and unaffected mappings.
Changes:
- Adjusted shared-column propagation ordering in
ModificationCommand. - Added regression coverage for sibling TPH types, single-derived and non-inherited entities, and restoring cleared complex values.
- Documented the shared-column propagation invariant in the update-pipeline skill.
| File | Description |
|---|---|
| test/EFCore.Relational.Specification.Tests/Update/NonSharedModelUpdatesTestBase.cs | Adds synchronous and asynchronous regression coverage for nulling and restoring complex properties across TPH and non-TPH mappings. |
| src/EFCore.Relational/Update/ModificationCommand.cs | Ensures shared-column writers are identified before null complex property propagation is skipped. |
| .agents/skills/update-pipeline/SKILL.md | Documents the shared-column propagation rule for null complex properties. |
Review effort: Lite
AndriySvyryd
marked this pull request as ready for review
November 15, 2026 21:20
Code coverage overviewLanguages: C# C# / code-coverage
View coverage of the 10 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
artl93
approved these changes
Nov 16, 2026
artl93
left a comment
Member
There was a problem hiding this comment.
Regression, customer reported. M2 approved.
cincuranet
approved these changes
Nov 16, 2026
cincuranet
approved these changes
Nov 16, 2026
AndriySvyryd
commented
Nov 16, 2026
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
SamMonoRT
approved these changes
Nov 16, 2026
AndriySvyryd
deleted the
copilot/fix-ef-core-11-optional-complex-property
branch
November 16, 2026 21:41
This was referenced Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #39596
Description
Setting an optional complex property to
nullon TPH sibling types sharing columns marked the entity modified but omitted those columns from the update. The update pipeline now identifies the shared-column writer before skipping propagation into a null complex property.Customer impact
The old complex-property values remain in the database instead of being cleared, potentially causing data corruption. No workaround on EF Core 11.0.0 is known.
How found
Customer-reported on EF Core 11.0.0
Regression
Regression from EF Core 10.0.x
Testing
Added synchronous and asynchronous regression coverage for both TPH sibling types, unaffected mappings, and restoring a complex value after clearing it.
Risk
Low, the change is limited to shared-column update generation.