You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This might be a bug or a configuration mistake on my part
Running the code below, I was expecting the Bug method to work but instead it is giving me this error
The property 'GrandChild.Id' is part of a key and so cannot be modified or marked as modified. To change the principal of an existing entity with an identifying foreign key, first delete the dependent and invoke 'SaveChanges', and then associate the dependent with the new principal.
But if I run the Work method, it work as expected.
I compared the change tracker in both scenario, the difference is for the Bug one the new child get added and the old one get deleted while the Work one leave it as Unmodified, everything else id identical.
This might be a bug or a configuration mistake on my part
Running the code below, I was expecting the Bug method to work but instead it is giving me this error
The property 'GrandChild.Id' is part of a key and so cannot be modified or marked as modified. To change the principal of an existing entity with an identifying foreign key, first delete the dependent and invoke 'SaveChanges', and then associate the dependent with the new principal.
But if I run the Work method, it work as expected.
I compared the change tracker in both scenario, the difference is for the Bug one the new child get added and the old one get deleted while the Work one leave it as Unmodified, everything else id identical.
Include provider and version information
Latest version of everything (net6) as of this post created date
The text was updated successfully, but these errors were encountered: