GraphDiff basically distinguishes between two kinds of relationships: owned and .
Own can be interpreted as "being part", meaning that everything that belongs to it will be inserted / updated / deleted with its owner.
Another kind of relationship handled by GraphDiff is related, which means that only changes to related objects, and not related entities, change GraphDiff when the chart is updated.
When you use the AssociatedEntity method, the state of the child is not part of the population, in other words, the changes you made to the child will not be saved, it will simply update the parent non-renew property.
Use the OwnedEntity method if you want to save the changes to a child, so I suggest you try the following:
dbContext.UpdateGraph<Customer>(entity, map => map.OwnedEntity(x => x.Address) .OwnedCollection(x => x.Categories, with => with.OwnedEntity(x => x.Category))); dbContext.SaveChanges();
source share