Skip to content

Conversation

@AndriySvyryd
Copy link
Member

Fixes #37373
Port of #37377

Description

EF added support for complex collections in 10, but the update pipeline contains an access pattern that's invalid for deleted entities.

Customer impact

When deleting an entity with a non-empty complex collection, an exception is thrown. A workaround is to clear the complex collections for any deleted entity.

How found

Multiple customer reports on EF 10.0.0

Regression

No, complex collections were introduced in EF 10.

Testing

Tests added

Risk

Low. Quirk added.

@AndriySvyryd AndriySvyryd requested a review from a team as a code owner December 15, 2025 20:25
@A-Stapleton
Copy link

@AndriySvyryd When you say a workaround is to clear the complex collections do you mean clear it and persist changes then in a separate operation delete the parent or just explicitly clear it?

@AndriySvyryd
Copy link
Member Author

@AndriySvyryd When you say a workaround is to clear the complex collections do you mean clear it and persist changes then in a separate operation delete the parent or just explicitly clear it?

Just clear them on any entity being deleted, in the same SaveChanges

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.

5 participants