Index: Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/AssessmentSectionExtensions.cs
===================================================================
diff -u -rf34577f6da915277f5098f362150d006aea972b7 -rc842725e65946a75ed597bc0320f0fae5df69625
--- Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/AssessmentSectionExtensions.cs (.../AssessmentSectionExtensions.cs) (revision f34577f6da915277f5098f362150d006aea972b7)
+++ Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/AssessmentSectionExtensions.cs (.../AssessmentSectionExtensions.cs) (revision c842725e65946a75ed597bc0320f0fae5df69625)
@@ -20,7 +20,9 @@
// All rights reserved.
using System;
+using System.Collections.Generic;
using System.ComponentModel;
+using System.Linq;
using Core.Common.Base.Data;
using Ringtoets.Common.Data.Contribution;
using Ringtoets.Common.Data.Hydraulics;
@@ -33,14 +35,14 @@
public static class AssessmentSectionExtensions
{
///
- /// Gets the normative assessment level from a .
+ /// Gets the normative assessment level for a .
///
- /// The assessment section.
- /// The hydraulic boundary location to get the normative
- /// assessment level from.
+ /// The assessment section to get the normative assessment level from.
+ /// The hydraulic boundary location to get the normative assessment level for.
/// The normative assessment level or when:
///
/// - is null;
+ /// - is not part of ;
/// - contains no corresponding calculation output.
///
///
@@ -66,15 +68,21 @@
typeof(NormType));
}
+ IEnumerable calculations;
+
switch (normType)
{
case NormType.Signaling:
- return hydraulicBoundaryLocation?.DesignWaterLevelCalculation2.Output?.Result ?? RoundedDouble.NaN;
+ calculations = assessmentSection.WaterLevelCalculationsForSignalingNorm;
+ break;
case NormType.LowerLimit:
- return hydraulicBoundaryLocation?.DesignWaterLevelCalculation3.Output?.Result ?? RoundedDouble.NaN;
+ calculations = assessmentSection.WaterLevelCalculationsForLowerLimitNorm;
+ break;
default:
throw new NotSupportedException();
}
+
+ return calculations.FirstOrDefault(c => ReferenceEquals(c.HydraulicBoundaryLocation, hydraulicBoundaryLocation))?.Output?.Result ?? RoundedDouble.NaN;
}
}
}
\ No newline at end of file