0
votes

I have an entity with a collection of entities as a navigation property (ICollection). When I do an update on the parent entity, which does not actually include a change to its fields, but only to fields on one or more of its children, those children's changes are not persisted. What needs to be done to cause those changes in the children? Do I need to iterate over each one and add it to the change set?

I'm using Entity Framework 5, but I believe this is the case for 4 as well.

1

1 Answers

0
votes

I'm not sure what you mean by update in this case but I guess you are working with detached entities and setting only parent entity as modified. That is not enough because it is not propagated to rest of the entity graph. You must set state for every instance which is affected by any modification.