Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ReadConversionCollector.cs =================================================================== diff -u -r0540405a7dbabf85dc02db30c79c3c58b0faeea6 -r056c24804fa3267952bebae1f58705bf45338b07 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ReadConversionCollector.cs (.../ReadConversionCollector.cs) (revision 0540405a7dbabf85dc02db30c79c3c58b0faeea6) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ReadConversionCollector.cs (.../ReadConversionCollector.cs) (revision 056c24804fa3267952bebae1f58705bf45338b07) @@ -43,6 +43,7 @@ private readonly Dictionary soilProfiles = CreateDictionary(); private readonly Dictionary surfaceLines = CreateDictionary(); private readonly Dictionary hydraulicBoundaryLocations = CreateDictionary(); + private readonly Dictionary grassCoverErosionOutwardsHydraulicBoundaryLocations = CreateDictionary(); private readonly Dictionary failureMechanismSections = CreateDictionary(); private readonly Dictionary dikeProfiles = CreateDictionary(); private readonly Dictionary foreshoreProfiles = CreateDictionary(); @@ -700,5 +701,77 @@ } #endregion + + #region GrassCoverErosionOutwardsHydraulicLocationEntity: 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(GrassCoverErosionOutwardsHydraulicLocationEntity entity, HydraulicBoundaryLocation model) + { + if (entity == null) + { + throw new ArgumentNullException("entity"); + } + if (model == null) + { + throw new ArgumentNullException("model"); + } + + grassCoverErosionOutwardsHydraulicBoundaryLocations[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(GrassCoverErosionOutwardsHydraulicLocationEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException("entity"); + } + return grassCoverErosionOutwardsHydraulicBoundaryLocations.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 HydraulicBoundaryLocation Get(GrassCoverErosionOutwardsHydraulicLocationEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException("entity"); + } + try + { + return grassCoverErosionOutwardsHydraulicBoundaryLocations[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion } } \ No newline at end of file