Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/PersistenceRegistry.cs =================================================================== diff -u -r583a729a502f52ca415627efcb2287886e8efb1d -r9ee8f17742a5407fd9453aeb12f20cfedb20c73e --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/PersistenceRegistry.cs (.../PersistenceRegistry.cs) (revision 583a729a502f52ca415627efcb2287886e8efb1d) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/PersistenceRegistry.cs (.../PersistenceRegistry.cs) (revision 9ee8f17742a5407fd9453aeb12f20cfedb20c73e) @@ -24,6 +24,7 @@ using System.Linq; using Application.Ringtoets.Storage.DbContext; using Core.Common.Utils; +using Ringtoets.ClosingStructures.Data; using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.GrassCoverErosionInwards.Data; @@ -52,6 +53,7 @@ private readonly Dictionary surfaceLines = CreateDictionary(); private readonly Dictionary hydraulicLocations = CreateDictionary(); private readonly Dictionary heightStructures = CreateDictionary(); + private readonly Dictionary closingStructures = CreateDictionary(); private static Dictionary CreateDictionary() { @@ -272,6 +274,22 @@ Register(heightStructures, 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 either: + /// + /// is null + /// is null + /// + internal void Register(ClosingStructureEntity entity, ClosingStructure model) + { + Register(closingStructures, entity, model); + } + #endregion #region Contains Methods @@ -386,6 +404,17 @@ return ContainsValue(grassCoverErosionInwardsCalculations, 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(ClosingStructure model) + { + return ContainsValue(closingStructures, model); + } + #endregion #region Get Methods @@ -559,6 +588,22 @@ return Get(heightStructures, 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 ClosingStructureEntity Get(ClosingStructure model) + { + return Get(closingStructures, model); + } + #endregion } } \ No newline at end of file