public SimpleParentChildResultSet SubmitChanges(ClientInfo clientInfo, SimpleParentChildChangeSet changeSet) { var resultSet = new SimpleParentChildResultSet(changeSet); using (var transactionScope = CreateSavingTransactionScope()) { using (var dataRepository = _repositoryFactory(clientInfo)) { // optional custom processing PreProcessing(clientInfo, ref changeSet, dataRepository); // apply chnages to repository ApplyChanges(dataRepository, dataRepository.ParentSet, changeSet, changeSet.ParentSet, clientInfo); ApplyChanges(dataRepository, dataRepository.ChildSet, changeSet, changeSet.ChildSet, clientInfo); // optional custom processing BeforeSaving(clientInfo, ref changeSet, dataRepository); // save changes SaveChanges(dataRepository, changeSet, resultSet); // optional custom processing PostProcessing(clientInfo, ref resultSet, dataRepository); } transactionScope.Complete(); } return(resultSet); }
partial void PostProcessing(ClientInfo clientInfo, ref SimpleParentChildResultSet result, ISimpleParentChildRepository repository);