Index: Ringtoets/Integration/src/Ringtoets.Integration.Service/RingtoetsDataSynchronizationService.cs =================================================================== diff -u -r45f6ed59c0f37f734395a471935982318d8bf9cf -r421cbbc8a7149960b5e6908bde1744c63e4d1169 --- Ringtoets/Integration/src/Ringtoets.Integration.Service/RingtoetsDataSynchronizationService.cs (.../RingtoetsDataSynchronizationService.cs) (revision 45f6ed59c0f37f734395a471935982318d8bf9cf) +++ Ringtoets/Integration/src/Ringtoets.Integration.Service/RingtoetsDataSynchronizationService.cs (.../RingtoetsDataSynchronizationService.cs) (revision 421cbbc8a7149960b5e6908bde1744c63e4d1169) @@ -41,8 +41,6 @@ using Ringtoets.GrassCoverErosionOutwards.Service; using Ringtoets.HeightStructures.Data; using Ringtoets.HeightStructures.Service; -using Ringtoets.Integration.Data.StandAlone; -using Ringtoets.Integration.Data.StandAlone.SectionResults; using Ringtoets.MacroStabilityInwards.Data; using Ringtoets.MacroStabilityInwards.Service; using Ringtoets.Piping.Data; @@ -710,69 +708,14 @@ return StabilityPointStructuresDataSynchronizationService.ClearReferenceLineDependentData(stabilityPointStructuresFailureMechanism); } - var duneErosionFailureMechanism = failureMechanism as DuneErosionFailureMechanism; - if (duneErosionFailureMechanism != null) - { - return ClearReferenceLineDependentData(duneErosionFailureMechanism); - } - - var grassCoverSlipOffInwardsFailureMechanism = failureMechanism as GrassCoverSlipOffInwardsFailureMechanism; - if (grassCoverSlipOffInwardsFailureMechanism != null) - { - return ClearReferenceLineDependentData(grassCoverSlipOffInwardsFailureMechanism); - } - - var grassCoverSlipOffOutwardsFailureMechanism = failureMechanism as GrassCoverSlipOffOutwardsFailureMechanism; - if (grassCoverSlipOffOutwardsFailureMechanism != null) - { - return ClearReferenceLineDependentData(grassCoverSlipOffOutwardsFailureMechanism); - } - - var macroStabilityOutwardsFailureMechanism = failureMechanism as MacroStabilityOutwardsFailureMechanism; - if (macroStabilityOutwardsFailureMechanism != null) - { - return ClearReferenceLineDependentData(macroStabilityOutwardsFailureMechanism); - } - - var microstabilityFailureMechanism = failureMechanism as MicrostabilityFailureMechanism; - if (microstabilityFailureMechanism != null) - { - return ClearReferenceLineDependentData(microstabilityFailureMechanism); - } - - var pipingStructureFailureMechanism = failureMechanism as PipingStructureFailureMechanism; - if (pipingStructureFailureMechanism != null) - { - return ClearReferenceLineDependentData(pipingStructureFailureMechanism); - } - - var strengthStabilityLengthwiseConstructionFailureMechanism = failureMechanism as StrengthStabilityLengthwiseConstructionFailureMechanism; - if (strengthStabilityLengthwiseConstructionFailureMechanism != null) - { - return ClearReferenceLineDependentData(strengthStabilityLengthwiseConstructionFailureMechanism); - } - - var technicalInnovationFailureMechanism = failureMechanism as TechnicalInnovationFailureMechanism; - if (technicalInnovationFailureMechanism != null) - { - return ClearReferenceLineDependentData(technicalInnovationFailureMechanism); - } - - var waterPressureAsphaltCoverFailureMechanism = failureMechanism as WaterPressureAsphaltCoverFailureMechanism; - if (waterPressureAsphaltCoverFailureMechanism != null) - { - return ClearReferenceLineDependentData(waterPressureAsphaltCoverFailureMechanism); - } - - throw new NotSupportedException("Cannot clear results of unsupported failure mechanism."); + return ClearReferenceLineDependentData(failureMechanism); } - private static ClearResults ClearReferenceLineDependentData(IFailureMechanism failureMechanism) - where TSectionResult : FailureMechanismSectionResult + private static ClearResults ClearReferenceLineDependentData(IFailureMechanism failureMechanism) { var removedObjects = new List(); removedObjects.AddRange(failureMechanism.Sections); - var failureMechanismWithSectionResults = failureMechanism as IHasSectionResults; + var failureMechanismWithSectionResults = failureMechanism as IHasSectionResults; if (failureMechanismWithSectionResults != null) { removedObjects.AddRange(failureMechanismWithSectionResults.SectionResults);