Thank you. I am using partial save approach but I expereince some proble with child elements.
My root entity (Person) has refs to Email entity.
[global::System.ComponentModel.DataAnnotations.AssociationAttribute("Email", "EmailId", "Id", IsForeignKey=true)]
public global::TFG.CompliGuard.ClearReportService.Domain.Email Email
I change some properties in Email child entity. entitySet.Where(dfp => dfp.HasChanges) returns only root element.
Then I call
var originalState = item.ExtractState(ExtractType.OriginalState);
var modifiedState = item.ExtractState(ExtractType.ModifiedState);
Because I made changes in ref entity Email, originalState = null and after entity.ApplyState(originalState, modifiedState) entity.Email = null.
TemporaryContext.SubmitChanges() treats entity as new because originalState was null and do not save any changes to Email entity. How to extract whole entities tree for root entity?