Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/DuneErosionDataSynchronizationService.cs =================================================================== diff -u -rd18c49efb0d6e0b49fb9a54daf3589d6069a62b1 -ree62f9ef8c69cd574bd23077bf9079e3e8fbdd8c --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/DuneErosionDataSynchronizationService.cs (.../DuneErosionDataSynchronizationService.cs) (revision d18c49efb0d6e0b49fb9a54daf3589d6069a62b1) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/DuneErosionDataSynchronizationService.cs (.../DuneErosionDataSynchronizationService.cs) (revision ee62f9ef8c69cd574bd23077bf9079e3e8fbdd8c) @@ -58,10 +58,12 @@ { throw new ArgumentNullException(nameof(failureMechanism)); } + if (hydraulicBoundaryLocations == null) { throw new ArgumentNullException(nameof(hydraulicBoundaryLocations)); } + if (duneLocations == null) { throw new ArgumentNullException(nameof(duneLocations)); @@ -112,6 +114,32 @@ .ToArray(); } + /// + /// Clears the output of the dune location calculations within the collection. + /// + /// The calculations for which the output needs to be cleared. + /// All objects changed during the clear. + /// Thrown when is null. + public static IEnumerable ClearDuneCalculationsOutput(IEnumerable calculations) + { + if (calculations == null) + { + throw new ArgumentNullException(nameof(calculations)); + } + + var affectedCalculations = new List(); + foreach (DuneLocationCalculation calculation in calculations) + { + if (calculation.Output != null) + { + calculation.Output = null; + affectedCalculations.Add(calculation); + } + } + + return affectedCalculations; + } + private static bool DoesHydraulicBoundaryLocationMatchWithDuneLocation(HydraulicBoundaryLocation hydraulicBoundaryLocation, ReadDuneLocation readDuneLocation) {