Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingSoilProfile.cs
===================================================================
diff -u -rdc324dd8b87bdcef3d6ed1c0a8f7ee721ffadfbd -rfab2798bdc0feb4454b6384aefbe9db3f9a294fb
--- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingSoilProfile.cs (.../PipingSoilProfile.cs) (revision dc324dd8b87bdcef3d6ed1c0a8f7ee721ffadfbd)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingSoilProfile.cs (.../PipingSoilProfile.cs) (revision fab2798bdc0feb4454b6384aefbe9db3f9a294fb)
@@ -40,16 +40,23 @@
/// The name of the profile.
/// The bottom level of the profile.
/// The collection of layers that should be part of the profile.
+ /// Identifier of the profile.
/// Thrown when contains no layers.
/// Thrown when is null.
- public PipingSoilProfile(string name, double bottom, IEnumerable layers)
+ public PipingSoilProfile(string name, double bottom, IEnumerable layers, long pipingSoilProfileId)
{
Name = name;
Bottom = bottom;
Layers = layers;
+ PipingSoilProfileId = pipingSoilProfileId;
}
///
+ /// Gets the database identifier of the .
+ ///
+ public long PipingSoilProfileId { get; private set; }
+
+ ///
/// Gets the bottom level of the .
///
public double Bottom { get; private set; }
@@ -79,34 +86,6 @@
}
///
- /// Validates the given . A valid has layers which
- /// all have values for which are greater than or equal to .
- ///
- /// The collection of to validate.
- /// Thrown when is null.
- /// Thrown when
- ///
- /// - contains no layers
- /// - contains a layer with the less than
- ///
- ///
- private void ValidateLayersCollection(IEnumerable collection)
- {
- if (collection == null)
- {
- throw new ArgumentNullException(@"collection", string.Format(Resources.Error_Cannot_Construct_PipingSoilProfile_Without_Layers));
- }
- if (!collection.Any())
- {
- throw new ArgumentException(Resources.Error_Cannot_Construct_PipingSoilProfile_Without_Layers);
- }
- if (collection.Any(l => l.Top < Bottom))
- {
- throw new ArgumentException(Resources.PipingSoilProfile_Layers_Layer_top_below_profile_bottom);
- }
- }
-
- ///
/// Gets the thickness of the given layer in the .
/// Thickness of a layer is determined by its top and the top of the layer below it.
///
@@ -128,11 +107,6 @@
throw new ArgumentException("Layer not found in profile.");
}
- public override string ToString()
- {
- return Name;
- }
-
///
/// Retrieves the thickness of the topmost aquifer layer under a certain .
/// Only the thickness of the part of the aquifer layer under the level is determined.
@@ -164,6 +138,39 @@
return GetLayerThicknessBelowLevel(currentTopAquiferLayer, level);
}
+ public override string ToString()
+ {
+ return Name;
+ }
+
+ ///
+ /// Validates the given . A valid has layers which
+ /// all have values for which are greater than or equal to .
+ ///
+ /// The collection of to validate.
+ /// Thrown when is null.
+ /// Thrown when
+ ///
+ /// - contains no layers
+ /// - contains a layer with the less than
+ ///
+ ///
+ private void ValidateLayersCollection(IEnumerable collection)
+ {
+ if (collection == null)
+ {
+ throw new ArgumentNullException(@"collection", string.Format(Resources.Error_Cannot_Construct_PipingSoilProfile_Without_Layers));
+ }
+ if (!collection.Any())
+ {
+ throw new ArgumentException(Resources.Error_Cannot_Construct_PipingSoilProfile_Without_Layers);
+ }
+ if (collection.Any(l => l.Top < Bottom))
+ {
+ throw new ArgumentException(Resources.PipingSoilProfile_Layers_Layer_top_below_profile_bottom);
+ }
+ }
+
private void ValidateLevelToBottom(double level)
{
if (level < Bottom)