Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/PersistenceRegistry.cs =================================================================== diff -u -r92598abae0206724835b91b3708e970ae09ac5de -r25cb0404c9026690062e1a17b1ef5e9ecdb176f6 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/PersistenceRegistry.cs (.../PersistenceRegistry.cs) (revision 92598abae0206724835b91b3708e970ae09ac5de) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/PersistenceRegistry.cs (.../PersistenceRegistry.cs) (revision 25cb0404c9026690062e1a17b1ef5e9ecdb176f6) @@ -45,21 +45,51 @@ /// internal class PersistenceRegistry { - private readonly Dictionary failureMechanismSections = CreateDictionary(); - private readonly Dictionary dikeProfiles = CreateDictionary(); - private readonly Dictionary foreshoreProfiles = CreateDictionary(); - private readonly Dictionary grassCoverErosionInwardsCalculations = CreateDictionary(); - private readonly Dictionary stochasticSoilModels = CreateDictionary(); - private readonly Dictionary stochasticSoilProfiles = CreateDictionary(); - private readonly Dictionary soilProfiles = CreateDictionary(); - private readonly Dictionary surfaceLines = CreateDictionary(); - private readonly Dictionary hydraulicLocations = CreateDictionary(); - private readonly Dictionary heightStructures = CreateDictionary(); - private readonly Dictionary closingStructures = CreateDictionary(); - private readonly Dictionary stabilityPointStructures = CreateDictionary(); - private readonly Dictionary> heightStructuresCalculations = CreateDictionary>(); - private readonly Dictionary> closingStructuresCalculations = CreateDictionary>(); + private readonly Dictionary failureMechanismSections = + CreateDictionary(); + private readonly Dictionary dikeProfiles = + CreateDictionary(); + + private readonly Dictionary foreshoreProfiles = + CreateDictionary(); + + private readonly Dictionary grassCoverErosionInwardsCalculations = + CreateDictionary(); + + private readonly Dictionary stochasticSoilModels = + CreateDictionary(); + + private readonly Dictionary stochasticSoilProfiles = + CreateDictionary(); + + private readonly Dictionary soilProfiles = + CreateDictionary(); + + private readonly Dictionary surfaceLines = + CreateDictionary(); + + private readonly Dictionary hydraulicLocations = + CreateDictionary(); + + private readonly Dictionary heightStructures = + CreateDictionary(); + + private readonly Dictionary closingStructures = + CreateDictionary(); + + private readonly Dictionary stabilityPointStructures = + CreateDictionary(); + + private readonly Dictionary> heightStructuresCalculations = + CreateDictionary>(); + + private readonly Dictionary> closingStructuresCalculations = + CreateDictionary>(); + + private readonly Dictionary> stabilityPointStructuresCalculations = + CreateDictionary>(); + private static Dictionary CreateDictionary() { return new Dictionary(new ReferenceEqualityComparer()); @@ -339,6 +369,20 @@ Register(closingStructuresCalculations, entity, model); } + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The + /// to be registered. + /// The to + /// be registered. + /// Thrown when any input parameter is null. + internal void Register(StabilityPointStructuresCalculationEntity entity, StructuresCalculation model) + { + Register(stabilityPointStructuresCalculations, entity, model); + } + #endregion #region Contains Methods @@ -497,6 +541,17 @@ return ContainsValue(closingStructuresCalculations, model); } + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(StructuresCalculation model) + { + return ContainsValue(stabilityPointStructuresCalculations, model); + } + #endregion #region Get Methods @@ -736,6 +791,23 @@ return Get(closingStructuresCalculations, model); } + /// + /// Obtains the which was + /// registered for the given . + /// + /// The for + /// which a read operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out + /// whether a create operation has been registered for . + internal StabilityPointStructuresCalculationEntity Get(StructuresCalculation model) + { + return Get(stabilityPointStructuresCalculations, model); + } + #endregion } } \ No newline at end of file