We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If you have a parent with a single child entity, not a Collection. When you set the state to Deleted, and GetChanges() it does not have changes.
Sample at: https://github.com/Srykr/DeleteChildFromParentTest
Does not have Changes:
[Fact] public void DeleteSingleFromParentOneToOne() { var parentwithSingleChild = new ChangeTrackingCollection<ParentwithSingleChild>( new ParentwithSingleChild { ParentId = 1, ParentName = "ParentName1", Child = new Child { ParentId = 1, ChildId = 1, ChildName = "ChildName2" } }); parentwithSingleChild.First().Child.TrackingState = TrackingState.Deleted; var changes = parentwithSingleChild.GetChanges(); changes.Should().HaveCount(1); }
Has Changes
[Fact] public void DeleteChildFromParentOneToMany() { var parentwithMultipleChildren = new ChangeTrackingCollection<ParentwithMultipleChildren>(new ParentwithMultipleChildren { ParentId = 1, ParentName = "ParentName1", Children = new ChangeTrackingCollection<Child> { new Child { ParentId =1, ChildId = 1, ChildName = "ChildName2" }, new Child { ParentId =1, ChildId = 2, ChildName = "ChildName2" } } }); parentwithMultipleChildren.First().Children.First().TrackingState = TrackingState.Deleted; var changes = parentwithMultipleChildren.GetChanges(); changes.Should().HaveCount(1); }
If I am doing something wrong, please advise as well.
Thank you.
The text was updated successfully, but these errors were encountered:
Thanks for the test and repro. I'll have a look to see if this is a bug.
Sorry, something went wrong.
No branches or pull requests
If you have a parent with a single child entity, not a Collection.
When you set the state to Deleted, and GetChanges() it does not have changes.
Sample at:
https://github.com/Srykr/DeleteChildFromParentTest
Does not have Changes:
Has Changes
If I am doing something wrong, please advise as well.
Thank you.
The text was updated successfully, but these errors were encountered: