Index: Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/AssessmentSectionExtensions.cs =================================================================== diff -u -r175cb39b49a146149811954e3800bebfc0819e3d -r83ad808e24b4781346cbf61955354127fd942a75 --- Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/AssessmentSectionExtensions.cs (.../AssessmentSectionExtensions.cs) (revision 175cb39b49a146149811954e3800bebfc0819e3d) +++ Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/AssessmentSectionExtensions.cs (.../AssessmentSectionExtensions.cs) (revision 83ad808e24b4781346cbf61955354127fd942a75) @@ -21,6 +21,8 @@ using System; using System.ComponentModel; +using System.Linq; +using Core.Common.Base; using Core.Common.Base.Data; using Ringtoets.Common.Data.Contribution; using Ringtoets.Common.Data.Hydraulics; @@ -33,15 +35,17 @@ public static class AssessmentSectionExtensions { /// - /// Gets the normative assessment level from a . + /// Gets the normative assessment level for a . /// - /// The assessment section. + /// The assessment section to get the normative assessment + /// level from. /// The hydraulic boundary location to get the normative - /// assessment level from. + /// assessment level for. /// The normative assessment level or when: /// /// is null; - /// contains no corresponding calculation output. + /// is not part of . + /// contains no corresponding calculation output. /// /// /// Thrown when @@ -66,15 +70,23 @@ typeof(NormType)); } + IObservableEnumerable 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(); } + + HydraulicBoundaryLocationCalculation calculation = calculations.FirstOrDefault(calc => ReferenceEquals(calc.HydraulicBoundaryLocation, hydraulicBoundaryLocation)); + + return calculation?.Output?.Result ?? RoundedDouble.NaN; } } } \ No newline at end of file