Skip to content

Add entry API overloads that work correctly with nullable value properties#38425

Open
AndriySvyryd wants to merge 2 commits into
mainfrom
OtherFixes
Open

Add entry API overloads that work correctly with nullable value properties#38425
AndriySvyryd wants to merge 2 commits into
mainfrom
OtherFixes

Conversation

@AndriySvyryd

Copy link
Copy Markdown
Member

This pull request introduces new overloads for the ComplexProperty API 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:

  • Added new overloads of ComplexProperty methods in EntityEntry, ComplexPropertyEntry, and ComplexElementEntry classes to support nullable value type (struct?) complex properties, enabling change tracking for optional nested complex properties. [1] [2] [3]

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 ComplexProperty overloads to EntityEntry<TEntity>, ComplexPropertyEntry<TEntity, TComplexProperty>, and ComplexElementEntry<TEntity, TComplexProperty> for Expression<...TNestedComplexProperty?> with where ... : 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.

Comment thread test/EFCore.Tests/ChangeTracking/EntityEntryTest.cs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@AndriySvyryd AndriySvyryd marked this pull request as ready for review June 13, 2026 04:14
@AndriySvyryd AndriySvyryd requested a review from a team as a code owner June 13, 2026 04:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

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.

3 participants