Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ReadConversionCollector.cs =================================================================== diff -u -r8e213638a22dd9f04d965d875bb58156db019be5 -r4afb3d635232a5570c867f890f2c8b4f973ea7f7 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ReadConversionCollector.cs (.../ReadConversionCollector.cs) (revision 8e213638a22dd9f04d965d875bb58156db019be5) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ReadConversionCollector.cs (.../ReadConversionCollector.cs) (revision 4afb3d635232a5570c867f890f2c8b4f973ea7f7) @@ -31,6 +31,7 @@ using Ringtoets.DuneErosion.Data; using Ringtoets.GrassCoverErosionInwards.Data; using Ringtoets.HeightStructures.Data; +using Ringtoets.MacroStabilityInwards.Data.SoilProfile; using Ringtoets.MacroStabilityInwards.Primitives; using Ringtoets.Piping.Data.SoilProfile; using Ringtoets.Piping.Primitives; @@ -56,6 +57,9 @@ private readonly Dictionary surfaceLines = CreateDictionary(); + private readonly Dictionary macroStabilityInwardsStochasticSoilProfiles = + CreateDictionary(); + private readonly Dictionary macroStabilityInwardsSoil1DProfiles = CreateDictionary(); @@ -376,6 +380,74 @@ #endregion + #region MacroStabilityInwardsStochasticSoilProfileEntity: 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 of the input parameters is null. + internal void Read(MacroStabilityInwardsStochasticSoilProfileEntity entity, MacroStabilityInwardsStochasticSoilProfile model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + macroStabilityInwardsStochasticSoilProfiles[entity] = model; + } + + /// + /// Checks whether a read operations has been registered for the given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool Contains(MacroStabilityInwardsStochasticSoilProfileEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + return macroStabilityInwardsStochasticSoilProfiles.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 MacroStabilityInwardsStochasticSoilProfile Get(MacroStabilityInwardsStochasticSoilProfileEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + try + { + return macroStabilityInwardsStochasticSoilProfiles[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + #region MacroStabilityInwardsSoilProfileOneDEntity: Read, Contains, Get ///