Add entry API overloads that work correctly with nullable value properties#38425
Open
AndriySvyryd wants to merge 2 commits into
Open
Add entry API overloads that work correctly with nullable value properties#38425AndriySvyryd wants to merge 2 commits into
AndriySvyryd wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request extends EF Core change-tracking entry APIs to better support nullable value-type (struct?) complex properties by adding new ComplexProperty(...) overloads on typed entry types, and updates tests/baselines/docs accordingly.
Changes:
- Added
ComplexPropertyoverloads toEntityEntry<TEntity>,ComplexPropertyEntry<TEntity, TComplexProperty>, andComplexElementEntry<TEntity, TComplexProperty>forExpression<...TNestedComplexProperty?>withwhere ... : struct. - Updated change-tracking and specification tests to include optional/nullable complex properties in coverage and expectations.
- Updated public API baseline and fixed minor documentation text.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/EFCore.Tests/ChangeTracking/EntityEntryTest.cs | Adds an optional nullable struct complex property to the model and updates entry/member expectations. |
| test/EFCore.Specification.Tests/PropertyValuesTestBase.cs | Extends property-values assertions to cover an additional optional complex property path. |
| test/EFCore.Specification.Tests/NonSharedModelTestBase.cs | Updates the guidance in exception messages thrown when initialization hasn’t occurred. |
| src/EFCore/Storage/IDatabaseCreator.cs | Fixes a small typo in XML documentation. |
| src/EFCore/EFCore.baseline.json | Updates API baseline for newly added overload(s). |
| src/EFCore/ChangeTracking/EntityEntry`.cs | Adds a ComplexProperty overload for nullable value-type complex properties on entity entries. |
| src/EFCore/ChangeTracking/ComplexPropertyEntry`.cs | Adds a ComplexProperty overload for nullable value-type nested complex properties on complex property entries. |
| src/EFCore/ChangeTracking/ComplexElementEntry`.cs | Adds a ComplexProperty overload for nullable value-type nested complex properties on complex element entries. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
cincuranet
approved these changes
Jun 17, 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.
This pull request introduces new overloads for the
ComplexPropertyAPI in EF Core's change tracking system to support nullable value type complex properties, and updates tests and documentation accordingly. It also includes minor documentation fixes and test improvements for better coverage of optional complex properties.API enhancements for complex property tracking:
ComplexPropertymethods inEntityEntry,ComplexPropertyEntry, andComplexElementEntryclasses to support nullable value type (struct?) complex properties, enabling change tracking for optional nested complex properties. [1] [2] [3]