Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/PersistenceRegistry.cs =================================================================== diff -u -ra20794746c723f3d02434953861bd3dc57800b73 -r47c3d018102688c579d1450a890f2c3691bcbcf2 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/PersistenceRegistry.cs (.../PersistenceRegistry.cs) (revision a20794746c723f3d02434953861bd3dc57800b73) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/PersistenceRegistry.cs (.../PersistenceRegistry.cs) (revision 47c3d018102688c579d1450a890f2c3691bcbcf2) @@ -22,9 +22,12 @@ using System; using System.Collections.Generic; using System.Linq; + using Application.Ringtoets.Storage.DbContext; + using Core.Common.Base.Geometry; using Core.Common.Utils; + using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Probability; @@ -87,127 +90,122 @@ private readonly Dictionary pipingProbabilityAssessmentInputs = CreateDictionary(); private readonly Dictionary probabilisticAssessmentOutputs = CreateDictionary(); - private static Dictionary CreateDictionary() - { - return new Dictionary(new ReferenceEqualityComparer()); - } - /// /// Registers a create or update operation for and the /// that was constructed with the information. /// - /// The to be registered. - /// The to be registered. + /// The + /// to be registered. + /// The to + /// be registered. /// Thrown when either: /// /// is null /// is null /// - internal void Register(FailureMechanismSectionEntity entity, FailureMechanismSection model) + public void Register(GrassCoverErosionInwardsCalculationEntity entity, GrassCoverErosionInwardsCalculation model) { - Register(failureMechanismSections, entity, model); + Register(grassCoverErosionInwardsCalculations, 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. + /// The + /// to be registered. + /// The to + /// be registered. /// Thrown when either: /// /// is null /// is null /// - internal void Register(PipingSectionResultEntity entity, PipingFailureMechanismSectionResult model) + public void Register(GrassCoverErosionInwardsOutputEntity entity, GrassCoverErosionInwardsOutput model) { - Register(pipingFailureMechanismSectionResults, entity, model); + Register(grassCoverErosionInwardsOutputs, 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. + /// The + /// to be registered. + /// The to + /// be registered. /// Thrown when either: /// /// is null /// is null /// - internal void Register(GrassCoverErosionInwardsFailureMechanismMetaEntity entity, GeneralGrassCoverErosionInwardsInput model) + public void Register(ProbabilisticOutputEntity entity, ProbabilityAssessmentOutput model) { - Register(generalGrassCoverErosionInwardsInputs, entity, model); + Register(probabilisticAssessmentOutputs, 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. + /// The to be registered. + /// The to be registered. /// Thrown when either: /// /// is null /// is null /// - internal void Register(DikeProfileEntity entity, DikeProfile model) + internal void Register(FailureMechanismSectionEntity entity, FailureMechanismSection model) { - Register(dikeProfiles, entity, model); + Register(failureMechanismSections, 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. + /// The to be registered. + /// The to be registered. /// Thrown when either: /// /// is null /// is null /// - public void Register(GrassCoverErosionInwardsCalculationEntity entity, GrassCoverErosionInwardsCalculation model) + internal void Register(PipingSectionResultEntity entity, PipingFailureMechanismSectionResult model) { - Register(grassCoverErosionInwardsCalculations, entity, model); + Register(pipingFailureMechanismSectionResults, 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. + /// The to be registered. + /// The to be registered. /// Thrown when either: /// /// is null /// is null /// - public void Register(GrassCoverErosionInwardsOutputEntity entity, GrassCoverErosionInwardsOutput model) + internal void Register(GrassCoverErosionInwardsFailureMechanismMetaEntity entity, GeneralGrassCoverErosionInwardsInput model) { - Register(grassCoverErosionInwardsOutputs, entity, model); + Register(generalGrassCoverErosionInwardsInputs, 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. + /// The to be registered. + /// The to be registered. /// Thrown when either: /// /// is null /// is null /// - public void Register(ProbabilisticOutputEntity entity, ProbabilityAssessmentOutput model) + internal void Register(DikeProfileEntity entity, DikeProfile model) { - Register(probabilisticAssessmentOutputs, entity, model); + Register(dikeProfiles, entity, model); } /// @@ -1245,7 +1243,7 @@ var orphanedGrassCoverErosionInwardsCalculationEntities = new List(); foreach (GrassCoverErosionInwardsCalculationEntity calculationEntity in dbContext.GrassCoverErosionInwardsCalculationEntities - .Where(e => e.GrassCoverErosionInwardsCalculationEntityId > 0)) + .Where(e => e.GrassCoverErosionInwardsCalculationEntityId > 0)) { if (!grassCoverErosionInwardsCalculations.ContainsKey(calculationEntity)) { @@ -1607,6 +1605,11 @@ dbContext.ProbabilisticOutputEntities.RemoveRange(orphanedProbabilisticOutputEntities); } + private static Dictionary CreateDictionary() + { + return new Dictionary(new ReferenceEqualityComparer()); + } + private bool ContainsValue(Dictionary collection, U model) { if (model == null)