Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModel.cs =================================================================== diff -u -r9162a6b006fbfb420db272291d01b330a9dc4bcf -r57bc6a475f6cdd57b1a0ebf70cdf533014afd1ff --- Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModel.cs (.../PipingStochasticSoilModel.cs) (revision 9162a6b006fbfb420db272291d01b330a9dc4bcf) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModel.cs (.../PipingStochasticSoilModel.cs) (revision 57bc6a475f6cdd57b1a0ebf70cdf533014afd1ff) @@ -40,17 +40,29 @@ /// Creates a new instance of . /// /// Name of the segment soil model. - /// Thrown when is + /// + /// Thrown when any parameter is /// null. - public PipingStochasticSoilModel(string name) + /// Thrown when + /// is empty. + public PipingStochasticSoilModel(string name, IEnumerable geometry) { if (name == null) { throw new ArgumentNullException(nameof(name)); } + if (geometry == null) + { + throw new ArgumentNullException(nameof(geometry)); + } + if (!geometry.Any()) + { + string message = string.Format("Het stochastische ondergrondmodel '{0}' moet een geometrie bevatten.", name); + throw new ArgumentException(message); + } Name = name; - Geometry = new List(); + Geometry = geometry; StochasticSoilProfiles = new List(); } @@ -60,9 +72,9 @@ public string Name { get; private set; } /// - /// Gets the list of geometry points. + /// Gets the geometry points. /// - public List Geometry { get; } + public IEnumerable Geometry { get; private set; } /// /// Gets the list of . @@ -89,11 +101,7 @@ } Name = fromModel.Name; - Geometry.Clear(); - foreach (Point2D point in fromModel.Geometry) - { - Geometry.Add(point); - } + Geometry = fromModel.Geometry; var newSoilProfiles = new List(); var updatedProfiles = new List();