Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsDataSynchronizationService.cs =================================================================== diff -u -rc537cb34ea1958407d7713522b548a62b1796aa1 -r1051f838aebbd5977351542027ce6330583b0d43 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsDataSynchronizationService.cs (.../GrassCoverErosionInwardsDataSynchronizationService.cs) (revision c537cb34ea1958407d7713522b548a62b1796aa1) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsDataSynchronizationService.cs (.../GrassCoverErosionInwardsDataSynchronizationService.cs) (revision 1051f838aebbd5977351542027ce6330583b0d43) @@ -19,9 +19,11 @@ // 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.GrassCoverErosionInwards.Data; +using Ringtoets.HydraRing.Data; namespace Ringtoets.GrassCoverErosionInwards.Service { @@ -42,9 +44,36 @@ .ForEachElementDo(ClearCalculationOutput); } - private static void ClearCalculationOutput(GrassCoverErosionInwardsCalculation calculation) + /// + /// Clears the output of the given . + /// + /// The to clear the output for. + /// Thrown when is null. + public static void ClearCalculationOutput(GrassCoverErosionInwardsCalculation 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(GrassCoverErosionInwardsFailureMechanism failureMechanism) + { + failureMechanism.Calculations + .Cast() + .Where(c => c.InputParameters.HydraulicBoundaryLocation != null) + .ForEachElementDo(ClearHydraulicBoundaryLocation); + } + + private static void ClearHydraulicBoundaryLocation(GrassCoverErosionInwardsCalculation calculation) + { + calculation.InputParameters.HydraulicBoundaryLocation = null; + } } } \ No newline at end of file