How can I update audit information contained in an entity before actually deleting it? I'm working on a class derived from DbContext.
I tried by changing the state to Modified, then set the updated info, then calling base.SaveChanges(), then marking it as Deleted. The problem comes when I try to call SaveChanges after setting the updated info. It appears that the other objects of the relation are marked as Deleted and I get this exception:
"A relationship from the 'ChildrenEntity' AssociationSet is in the 'Deleted' state. Given multiplicity constraints, a corresponding 'ParentEntity' must also in the 'Deleted' state."
Thanks!