Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ReadConversionCollector.cs =================================================================== diff -u -r04cb34562587c9b06345f2e639c57394e6a7d0a7 -r4f89601cb9d77ff379727afd64f902a0aff74fa3 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ReadConversionCollector.cs (.../ReadConversionCollector.cs) (revision 04cb34562587c9b06345f2e639c57394e6a7d0a7) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ReadConversionCollector.cs (.../ReadConversionCollector.cs) (revision 4f89601cb9d77ff379727afd64f902a0aff74fa3) @@ -56,6 +56,7 @@ private readonly Dictionary closingStructures = CreateDictionary(); private readonly Dictionary stabilityPointStructures = CreateDictionary(); private readonly Dictionary> heightStructuresCalculations = CreateDictionary>(); + private readonly Dictionary> closingStructuresCalculations = CreateDictionary>(); private static Dictionary CreateDictionary() { @@ -997,6 +998,77 @@ #endregion + #region ClosingStructuresCalculationEntity: Read, Contains, Get + + /// + /// Registers a read operation for + /// and the that was constructed + /// with the information. + /// + /// The + /// that was read. + /// The that + /// was constructed. + /// Thrown when any input parameter is null. + internal void Read(ClosingStructuresCalculationEntity entity, StructuresCalculation model) + { + if (entity == null) + { + throw new ArgumentNullException("entity"); + } + if (model == null) + { + throw new ArgumentNullException("model"); + } + + closingStructuresCalculations[entity] = model; + } + + /// + /// Checks whether a read operation has been registered for a given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool Contains(ClosingStructuresCalculationEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException("entity"); + } + return closingStructuresCalculations.ContainsKey(entity); + } + + /// + /// Obtains the which was read + /// for the given . + /// + /// The for which a read + /// operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has + /// been registered for . + /// Use + /// to find out whether a read operation has been registered for . + internal StructuresCalculation Get(ClosingStructuresCalculationEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException("entity"); + } + try + { + return closingStructuresCalculations[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + #region StabilityPointStructureEntity: Read, Contains, Get ///