Index: Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingDataSynchronizationService.cs
===================================================================
diff -u -r036199c1cde97f98829dc4405169ec327d2a1b95 -rb1537a16c5961d9f66d5564c215f4bee59294f82
--- Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingDataSynchronizationService.cs (.../PipingDataSynchronizationService.cs) (revision 036199c1cde97f98829dc4405169ec327d2a1b95)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingDataSynchronizationService.cs (.../PipingDataSynchronizationService.cs) (revision b1537a16c5961d9f66d5564c215f4bee59294f82)
@@ -253,6 +253,38 @@
}
///
+ /// Removes all from the
+ /// and clears all data that depends on it, either directly or indirectly.
+ ///
+ /// The failure mechanism.
+ /// All objects that are affected by this operation.
+ /// Thrown when
+ /// is null.
+ public static IEnumerable RemoveAllStochasticSoilModels(PipingFailureMechanism failureMechanism)
+ {
+ if (failureMechanism == null)
+ {
+ throw new ArgumentNullException(nameof(failureMechanism));
+ }
+
+ IEnumerable affectedCalculationScenarios =
+ failureMechanism.Calculations
+ .Cast()
+ .Where(calc => calc.InputParameters.StochasticSoilModel != null).ToArray();
+
+ var affectedObjects = new List();
+ foreach (PipingCalculation calculation in affectedCalculationScenarios)
+ {
+ affectedObjects.AddRange(RingtoetsCommonDataSynchronizationService.ClearCalculationOutput(calculation));
+ affectedObjects.AddRange(ClearStochasticSoilModel(calculation.InputParameters));
+ }
+
+ failureMechanism.StochasticSoilModels.Clear();
+ affectedObjects.Add(failureMechanism.StochasticSoilModels);
+ return affectedObjects;
+ }
+
+ ///
/// Removes a given from calculations in the
/// and clears all data that depends on it, either directly or indirectly.
///