Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/DuneErosionDataSynchronizationService.cs =================================================================== diff -u -r446331426de42bdbfe335cab941bd2bb32292340 -rbc8aa3634aa6fb9e673c60c230844ea8827affb2 --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/DuneErosionDataSynchronizationService.cs (.../DuneErosionDataSynchronizationService.cs) (revision 446331426de42bdbfe335cab941bd2bb32292340) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/DuneErosionDataSynchronizationService.cs (.../DuneErosionDataSynchronizationService.cs) (revision bc8aa3634aa6fb9e673c60c230844ea8827affb2) @@ -101,23 +101,6 @@ } /// - /// Clears the output of the dune locations within the collection. - /// - /// The locations for which the output needs to be cleared. - /// All objects changed during the clear. - /// Thrown when is null. - public static IEnumerable ClearDuneLocationOutput(IEnumerable locations) - { - if (locations == null) - { - throw new ArgumentNullException(nameof(locations)); - } - - return locations.SelectMany(ClearDuneLocationOutput) - .ToArray(); - } - - /// /// Clears the output of the dune location calculations within the dune erosion failure mechanism. /// /// The failure mechanism for which the output of the calculations needs to be cleared. @@ -132,18 +115,19 @@ var affectedCalculations = new List(); - affectedCalculations.AddRange(ClearDuneCalculationsOutput(failureMechanism.CalculationsForMechanismSpecificFactorizedSignalingNorm)); - affectedCalculations.AddRange(ClearDuneCalculationsOutput(failureMechanism.CalculationsForMechanismSpecificSignalingNorm)); - affectedCalculations.AddRange(ClearDuneCalculationsOutput(failureMechanism.CalculationsForMechanismSpecificLowerLimitNorm)); - affectedCalculations.AddRange(ClearDuneCalculationsOutput(failureMechanism.CalculationsForLowerLimitNorm)); - affectedCalculations.AddRange(ClearDuneCalculationsOutput(failureMechanism.CalculationsForFactorizedLowerLimitNorm)); + affectedCalculations.AddRange(ClearDuneLocationCalculationsOutput(failureMechanism.CalculationsForMechanismSpecificFactorizedSignalingNorm)); + affectedCalculations.AddRange(ClearDuneLocationCalculationsOutput(failureMechanism.CalculationsForMechanismSpecificSignalingNorm)); + affectedCalculations.AddRange(ClearDuneLocationCalculationsOutput(failureMechanism.CalculationsForMechanismSpecificLowerLimitNorm)); + affectedCalculations.AddRange(ClearDuneLocationCalculationsOutput(failureMechanism.CalculationsForLowerLimitNorm)); + affectedCalculations.AddRange(ClearDuneLocationCalculationsOutput(failureMechanism.CalculationsForFactorizedLowerLimitNorm)); return affectedCalculations; } - private static IEnumerable ClearDuneCalculationsOutput(IEnumerable calculations) + private static IEnumerable ClearDuneLocationCalculationsOutput(IEnumerable calculations) { IEnumerable affectedCalculations = calculations.Where(c => c.Output != null).ToArray(); + affectedCalculations.ForEachElementDo(c => c.Output = null); return affectedCalculations; @@ -175,14 +159,5 @@ return match.Groups["Offset"].Value == duneLocationOffset; } - - private static IEnumerable ClearDuneLocationOutput(DuneLocation location) - { - if (location.Calculation.Output != null) - { - location.Calculation.Output = null; - yield return location; - } - } } } \ No newline at end of file