Index: Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingDataSynchronizationService.cs
===================================================================
diff -u -r1051f838aebbd5977351542027ce6330583b0d43 -rd9e5e7ea1e028347a738fc8e3d9c158a9b53ce15
--- Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingDataSynchronizationService.cs (.../PipingDataSynchronizationService.cs) (revision 1051f838aebbd5977351542027ce6330583b0d43)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingDataSynchronizationService.cs (.../PipingDataSynchronizationService.cs) (revision d9e5e7ea1e028347a738fc8e3d9c158a9b53ce15)
@@ -20,6 +20,7 @@
// All rights reserved.
using System;
+using System.Collections.Generic;
using System.Linq;
using Core.Common.Utils.Extensions;
using Ringtoets.HydraRing.Data;
@@ -36,12 +37,17 @@
/// Clears the output for all calculations in the .
///
/// The which contains the calculations.
- public static void ClearAllCalculationOutput(PipingFailureMechanism failureMechanism)
+ /// An of calculations which are affected by clearing the output.
+ public static IEnumerable ClearAllCalculationOutput(PipingFailureMechanism failureMechanism)
{
- failureMechanism.Calculations
- .Cast()
- .Where(c => c.HasOutput)
- .ForEachElementDo(ClearCalculationOutput);
+ var affectedItems = failureMechanism.Calculations
+ .Cast()
+ .Where(c => c.HasOutput)
+ .ToArray();
+
+ affectedItems.ForEachElementDo(ClearCalculationOutput);
+
+ return affectedItems;
}
///
@@ -63,12 +69,17 @@
/// Clears the for all the calculations in the .
///
/// The which contains the calculations.
- public static void ClearHydraulicBoundaryLocations(PipingFailureMechanism failureMechanism)
+ /// An of calculations which are affected by clearing the output.
+ public static IEnumerable ClearHydraulicBoundaryLocations(PipingFailureMechanism failureMechanism)
{
- failureMechanism.Calculations
- .Cast()
- .Where(c => c.InputParameters.HydraulicBoundaryLocation != null)
- .ForEachElementDo(ClearHydraulicBoundaryLocation);
+ var affectedItems = failureMechanism.Calculations
+ .Cast()
+ .Where(c => c.InputParameters.HydraulicBoundaryLocation != null)
+ .ToArray();
+
+ affectedItems.ForEachElementDo(ClearHydraulicBoundaryLocation);
+
+ return affectedItems;
}
private static void ClearHydraulicBoundaryLocation(PipingCalculation calculation)