Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModel.cs =================================================================== diff -u -rb1cb91cbc7d2332a1a82c5d1361c25cd5a4a6ddc -r6b60edb4d7f04f83c74089d70a72c4f79ed413dd --- Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModel.cs (.../PipingStochasticSoilModel.cs) (revision b1cb91cbc7d2332a1a82c5d1361c25cd5a4a6ddc) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModel.cs (.../PipingStochasticSoilModel.cs) (revision 6b60edb4d7f04f83c74089d70a72c4f79ed413dd) @@ -37,16 +37,19 @@ /// public class PipingStochasticSoilModel : Observable, IMechanismStochasticSoilModel { + private readonly List stochasticSoilProfiles = new List(); + /// /// Creates a new instance of . /// /// Name of the segment soil model. - /// + /// The geometry of the stochastic soil model. + /// The stochastic soil profiles of the model. /// Thrown when any parameter is /// null. /// Thrown when - /// is empty. - public PipingStochasticSoilModel(string name, IEnumerable geometry) + /// or is empty. + public PipingStochasticSoilModel(string name, IEnumerable geometry, IEnumerable stochasticSoilProfiles) { if (name == null) { @@ -56,6 +59,10 @@ { throw new ArgumentNullException(nameof(geometry)); } + if (stochasticSoilProfiles == null) + { + throw new ArgumentNullException(nameof(stochasticSoilProfiles)); + } if (!geometry.Any()) { string message = string.Format(RingtoetsCommonDataResources.StochasticSoilModel_Geometry_of_StochasticSoilModelName_0_must_contain_a_geometry, name); @@ -64,7 +71,7 @@ Name = name; Geometry = geometry; - StochasticSoilProfiles = new List(); + this.stochasticSoilProfiles.AddRange(stochasticSoilProfiles); } /// @@ -78,9 +85,15 @@ public IEnumerable Geometry { get; private set; } /// - /// Gets the list of . + /// Gets the collection of . /// - public List StochasticSoilProfiles { get; } + public IEnumerable StochasticSoilProfiles + { + get + { + return stochasticSoilProfiles; + } + } /// /// Updates the with the properties from . @@ -124,7 +137,7 @@ } else { - StochasticSoilProfiles.Add(fromProfile); + stochasticSoilProfiles.Add(fromProfile); addedProfiles.Add(fromProfile); } newSoilProfiles.Add(fromProfile.SoilProfile); @@ -134,7 +147,7 @@ sp => !newSoilProfiles.Any(newSp => IsSame(newSp, sp.SoilProfile))).ToArray(); foreach (PipingStochasticSoilProfile profileToRemove in remainingProfiles) { - StochasticSoilProfiles.Remove(profileToRemove); + stochasticSoilProfiles.Remove(profileToRemove); removedProfiles.Add(profileToRemove); }