Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Service/GrassCoverErosionOutwardsDataSynchronizationService.cs
===================================================================
diff -u -r41a37c93cb0b3e36ff7023c9f42b4e6225598b55 -r76cc41df36e8ea1a4ef3c21d8886875b9c1c10c0
--- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Service/GrassCoverErosionOutwardsDataSynchronizationService.cs (.../GrassCoverErosionOutwardsDataSynchronizationService.cs) (revision 41a37c93cb0b3e36ff7023c9f42b4e6225598b55)
+++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Service/GrassCoverErosionOutwardsDataSynchronizationService.cs (.../GrassCoverErosionOutwardsDataSynchronizationService.cs) (revision 76cc41df36e8ea1a4ef3c21d8886875b9c1c10c0)
@@ -25,6 +25,7 @@
using System.Linq;
using Core.Common.Base;
using Core.Common.Base.Data;
+using Core.Common.Utils.Extensions;
using Ringtoets.GrassCoverErosionOutwards.Data;
using Ringtoets.HydraRing.Data;
@@ -124,6 +125,32 @@
return affectedItems;
}
+ ///
+ /// Clears the output for all calculations in the .
+ ///
+ /// The
+ /// which contains the calculations.
+ /// An of calculations which are affected by
+ /// clearing the output.
+ /// Thrown when
+ /// is null.
+ public static IEnumerable ClearAllWaveConditionsCalculationOutput(GrassCoverErosionOutwardsFailureMechanism failureMechanism)
+ {
+ if (failureMechanism == null)
+ {
+ throw new ArgumentNullException("failureMechanism");
+ }
+
+ var affectedItems = failureMechanism.Calculations
+ .Cast()
+ .Where(c => c.HasOutput)
+ .ToArray();
+
+ affectedItems.ForEachElementDo(ClearWaveConditionsCalculationOutput);
+
+ return affectedItems;
+ }
+
private static void ClearHydraulicBoundaryLocation(GrassCoverErosionOutwardsWaveConditionsCalculation calculation)
{
calculation.InputParameters.HydraulicBoundaryLocation = null;