Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/PersistenceRegistry.cs =================================================================== diff -u -rc482712c0ff06d5654836fc8d9af535641d63ffb -r8a15fe6e429a0f177f25defaf1851c9963374dbe --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/PersistenceRegistry.cs (.../PersistenceRegistry.cs) (revision c482712c0ff06d5654836fc8d9af535641d63ffb) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/PersistenceRegistry.cs (.../PersistenceRegistry.cs) (revision 8a15fe6e429a0f177f25defaf1851c9963374dbe) @@ -70,6 +70,7 @@ private readonly Dictionary pipingStructureFailureMechanismSectionResults = new Dictionary(); private readonly Dictionary duneErosionFailureMechanismSectionResults = new Dictionary(); private readonly Dictionary stabilityStoneCoverFailureMechanismSectionResults = new Dictionary(); + private readonly Dictionary strengthStabilityPointConstructionFailureMechanismSectionResults = new Dictionary(); private readonly Dictionary hydraulicLocations = new Dictionary(new ReferenceEqualityComparer()); private readonly Dictionary calculationGroups = new Dictionary(new ReferenceEqualityComparer()); private readonly Dictionary pipingCalculations = new Dictionary(new ReferenceEqualityComparer()); @@ -376,6 +377,22 @@ /// Registers a create or update operation for and the /// that was constructed with the information. /// + /// The to be registered. + /// The to be registered. + /// Thrown when either: + /// + /// is null + /// is null + /// + public void Register(StrengthStabilityPointConstructionSectionResultEntity entity, StrengthStabilityPointConstructionFailureMechanismSectionResult model) + { + Register(strengthStabilityPointConstructionFailureMechanismSectionResults, entity, model); + } + + /// + /// Registers a create or update operation for and the + /// that was constructed with the information. + /// /// The to be registered. /// The to be registered. /// Thrown when either: @@ -927,6 +944,11 @@ stabilityStoneCoverFailureMechanismSectionResults[entity].StorageId = entity.StabilityStoneCoverSectionResultEntityId; } + foreach (var entity in strengthStabilityPointConstructionFailureMechanismSectionResults.Keys) + { + strengthStabilityPointConstructionFailureMechanismSectionResults[entity].StorageId = entity.StrengthStabilityPointConstructionSectionResultEntityId; + } + foreach (var entity in hydraulicLocations.Keys) { hydraulicLocations[entity].StorageId = entity.HydraulicLocationEntityId; @@ -1228,6 +1250,17 @@ } dbContext.StabilityStoneCoverSectionResultEntities.RemoveRange(orphanedStabilityStoneCoverSectionResultEntities); + var orphanedStrengthStabilityPointConstructionSectionResultEntities = new List(); + foreach (StrengthStabilityPointConstructionSectionResultEntity sectionResultEntity in dbContext.StrengthStabilityPointConstructionSectionResultEntities + .Where(e => e.StrengthStabilityPointConstructionSectionResultEntityId > 0)) + { + if (!strengthStabilityPointConstructionFailureMechanismSectionResults.ContainsKey(sectionResultEntity)) + { + orphanedStrengthStabilityPointConstructionSectionResultEntities.Add(sectionResultEntity); + } + } + dbContext.StrengthStabilityPointConstructionSectionResultEntities.RemoveRange(orphanedStrengthStabilityPointConstructionSectionResultEntities); + var orphanedHydraulicLocationEntities = new List(); foreach (HydraulicLocationEntity hydraulicLocationEntity in dbContext.HydraulicLocationEntities .Where(e => e.HydraulicLocationEntityId > 0))