InvalidOperationException: "Collection was modified" inside NavigationFixer #8101
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-bug
Milestone
I have some code that is adding an entity to the DbContext if it hasn't previously been added. This works in most cases, however, in one case I've found, there's an exception being throw in the
ChangeTracking.Internal.NavigationFixer
.The code is:
The exact exception is:
The stack trace is:
I went through the source code in that class and I only see some "foreach" loops, but I'm not immediately aware of anything I may be doing to affect these Enumerables.
I'm still investigating.
The only thing of note so far is that the TEntity type in the HashSet in the stack trace is a child collection of the TEntity type passed into the Add method in the first code snippet.
The text was updated successfully, but these errors were encountered: