Index: Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingDataSynchronizationService.cs =================================================================== diff -u -rc537cb34ea1958407d7713522b548a62b1796aa1 -r1051f838aebbd5977351542027ce6330583b0d43 --- Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingDataSynchronizationService.cs (.../PipingDataSynchronizationService.cs) (revision c537cb34ea1958407d7713522b548a62b1796aa1) +++ Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingDataSynchronizationService.cs (.../PipingDataSynchronizationService.cs) (revision 1051f838aebbd5977351542027ce6330583b0d43) @@ -19,8 +19,10 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Linq; using Core.Common.Utils.Extensions; +using Ringtoets.HydraRing.Data; using Ringtoets.Piping.Data; namespace Ringtoets.Piping.Service @@ -42,9 +44,36 @@ .ForEachElementDo(ClearCalculationOutput); } - private static void ClearCalculationOutput(PipingCalculation calculation) + /// + /// Clears the output of the given . + /// + /// The to clear the output for. + /// Thrown when is null. + public static void ClearCalculationOutput(PipingCalculation calculation) { + if (calculation == null) + { + throw new ArgumentNullException("calculation"); + } + calculation.Output = null; } + + /// + /// Clears the for all the calculations in the . + /// + /// The which contains the calculations. + public static void ClearHydraulicBoundaryLocations(PipingFailureMechanism failureMechanism) + { + failureMechanism.Calculations + .Cast() + .Where(c => c.InputParameters.HydraulicBoundaryLocation != null) + .ForEachElementDo(ClearHydraulicBoundaryLocation); + } + + private static void ClearHydraulicBoundaryLocation(PipingCalculation calculation) + { + calculation.InputParameters.HydraulicBoundaryLocation = null; + } } } \ No newline at end of file