Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsStochasticSoilModel.cs
===================================================================
diff -u -r9f936b0b29f490a024df02345df182133b1c041a -rda4a311b2ac60defe1a27a61c8d151f47268a941
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsStochasticSoilModel.cs (.../MacroStabilityInwardsStochasticSoilModel.cs) (revision 9f936b0b29f490a024df02345df182133b1c041a)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsStochasticSoilModel.cs (.../MacroStabilityInwardsStochasticSoilModel.cs) (revision da4a311b2ac60defe1a27a61c8d151f47268a941)
@@ -52,14 +52,42 @@
}
///
+ /// Creates a new instance of .
+ ///
+ /// Name of the segment soil model.
+ /// The geometry of the segment soil model.
+ /// Thrown when any parameter is null.
+ /// Thrown when is empty.
+ public MacroStabilityInwardsStochasticSoilModel(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();
+ }
+
+ Name = name;
+ Geometry = geometry;
+ StochasticSoilProfiles = new List();
+ }
+
+ ///
/// Gets the name of the segment soil model.
///
public string Name { get; private set; }
///
/// Gets the list of geometry points.
///
- public List Geometry { get; }
+ public IEnumerable Geometry { get; private set; }
///
/// Gets the list of .
@@ -86,12 +114,8 @@
}
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();
var addedProfiles = new List();