Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ReadConversionCollector.cs =================================================================== diff -u -r30b8231f92b90ea4b05e98e3d0285368f6dfe2e4 -r0540405a7dbabf85dc02db30c79c3c58b0faeea6 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ReadConversionCollector.cs (.../ReadConversionCollector.cs) (revision 30b8231f92b90ea4b05e98e3d0285368f6dfe2e4) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ReadConversionCollector.cs (.../ReadConversionCollector.cs) (revision 0540405a7dbabf85dc02db30c79c3c58b0faeea6) @@ -45,6 +45,7 @@ private readonly Dictionary hydraulicBoundaryLocations = CreateDictionary(); private readonly Dictionary failureMechanismSections = CreateDictionary(); private readonly Dictionary dikeProfiles = CreateDictionary(); + private readonly Dictionary foreshoreProfiles = CreateDictionary(); private readonly Dictionary grassCoverErosionInwardsCalculations = CreateDictionary(); private static Dictionary CreateDictionary() @@ -553,6 +554,78 @@ #endregion + #region ForeshoreProfileEntity: 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 either: + /// + /// is null + /// is null + /// + internal void Read(ForeshoreProfileEntity entity, ForeshoreProfile model) + { + if (entity == null) + { + throw new ArgumentNullException("entity"); + } + if (model == null) + { + throw new ArgumentNullException("model"); + } + + foreshoreProfiles[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(ForeshoreProfileEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException("entity"); + } + return foreshoreProfiles.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 ForeshoreProfile Get(ForeshoreProfileEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException("entity"); + } + try + { + return foreshoreProfiles[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + #region GrassCoverErosionInwardsCalculationEntity: Read, Contains, Get ///