Index: Ringtoets/Integration/src/Ringtoets.Integration.Service/RingtoetsDataSynchronizationService.cs
===================================================================
diff -u -r6f46ce9a263e50bca4ff0cb32973f330defd6f3b -rdee01f6d6c15af0cc124816bfe99c7658af8995d
--- Ringtoets/Integration/src/Ringtoets.Integration.Service/RingtoetsDataSynchronizationService.cs (.../RingtoetsDataSynchronizationService.cs) (revision 6f46ce9a263e50bca4ff0cb32973f330defd6f3b)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Service/RingtoetsDataSynchronizationService.cs (.../RingtoetsDataSynchronizationService.cs) (revision dee01f6d6c15af0cc124816bfe99c7658af8995d)
@@ -212,7 +212,7 @@
///
/// The assessment section.
/// All observable objects affected by this method.
- /// Thrown when
+ /// Thrown when
/// is null.
public static IEnumerable ClearReferenceLine(IAssessmentSection assessmentSection)
{
@@ -272,7 +272,6 @@
}
}
- // Lastly: clear the reference line:
assessmentSection.ReferenceLine = null;
list.Add(assessmentSection);
@@ -283,11 +282,11 @@
/// Removes a given from the
/// and clears all data that depends on it, either directly or indirectly.
///
- /// The failure mechanism containing at least one profile.
+ /// The failure mechanism containing .
/// The profile residing in
/// that should be removed.
/// All observable objects affected by this method.
- /// Thrown when
+ /// Thrown when
/// or is null.
public static IEnumerable RemoveForeshoreProfile(HeightStructuresFailureMechanism failureMechanism, ForeshoreProfile profile)
{
@@ -301,17 +300,8 @@
}
var changedObservables = new List();
- StructuresCalculation[] calculations = failureMechanism.Calculations
- .Cast>()
- .ToArray();
- StructuresCalculation[] calculationWithRemovedForeshoreProfile = calculations
- .Where(c => ReferenceEquals(c.InputParameters.ForeshoreProfile, profile))
- .ToArray();
- foreach (StructuresCalculation calculation in calculationWithRemovedForeshoreProfile)
- {
- calculation.InputParameters.ForeshoreProfile = null;
- changedObservables.Add(calculation.InputParameters);
- }
+ IEnumerable> calculations = failureMechanism.Calculations.Cast>();
+ changedObservables.AddRange(RingtoetsCommonDataSynchronizationService.ClearForeshoreProfile(calculations, profile));
failureMechanism.ForeshoreProfiles.Remove(profile);
changedObservables.Add(failureMechanism.ForeshoreProfiles);
@@ -323,11 +313,11 @@
/// Removes a given from the
/// and clears all data that depends on it, either directly or indirectly.
///
- /// The failure mechanism containing at least one profile.
+ /// The failure mechanism containing .
/// The profile residing in
/// that should be removed.
/// All observable objects affected by this method.
- /// Thrown when
+ /// Thrown when
/// or is null.
public static IEnumerable RemoveForeshoreProfile(ClosingStructuresFailureMechanism failureMechanism, ForeshoreProfile profile)
{
@@ -341,17 +331,8 @@
}
var changedObservables = new List();
- StructuresCalculation[] calculations = failureMechanism.Calculations
- .Cast>()
- .ToArray();
- StructuresCalculation[] calculationWithRemovedForeshoreProfile = calculations
- .Where(c => ReferenceEquals(c.InputParameters.ForeshoreProfile, profile))
- .ToArray();
- foreach (StructuresCalculation calculation in calculationWithRemovedForeshoreProfile)
- {
- calculation.InputParameters.ForeshoreProfile = null;
- changedObservables.Add(calculation.InputParameters);
- }
+ IEnumerable> calculations = failureMechanism.Calculations.Cast>();
+ changedObservables.AddRange(RingtoetsCommonDataSynchronizationService.ClearForeshoreProfile(calculations, profile));
failureMechanism.ForeshoreProfiles.Remove(profile);
changedObservables.Add(failureMechanism.ForeshoreProfiles);
@@ -363,11 +344,11 @@
/// Removes a given from the
/// and clears all data that depends on it, either directly or indirectly.
///
- /// The failure mechanism containing at least one profile.
+ /// The failure mechanism containing .
/// The profile residing in
/// that should be removed.
/// All observable objects affected by this method.
- /// Thrown when
+ /// Thrown when
/// or is null.
public static IEnumerable RemoveForeshoreProfile(StabilityPointStructuresFailureMechanism failureMechanism, ForeshoreProfile profile)
{
@@ -381,17 +362,8 @@
}
var changedObservables = new List();
- StructuresCalculation[] calculations = failureMechanism.Calculations
- .Cast>()
- .ToArray();
- StructuresCalculation[] calculationWithRemovedForeshoreProfile = calculations
- .Where(c => ReferenceEquals(c.InputParameters.ForeshoreProfile, profile))
- .ToArray();
- foreach (StructuresCalculation calculation in calculationWithRemovedForeshoreProfile)
- {
- calculation.InputParameters.ForeshoreProfile = null;
- changedObservables.Add(calculation.InputParameters);
- }
+ IEnumerable> calculations = failureMechanism.Calculations.Cast>();
+ changedObservables.AddRange(RingtoetsCommonDataSynchronizationService.ClearForeshoreProfile(calculations, profile));
failureMechanism.ForeshoreProfiles.Remove(profile);
changedObservables.Add(failureMechanism.ForeshoreProfiles);
@@ -403,11 +375,11 @@
/// Removes a given from the
/// and clears all data that depends on it, either directly or indirectly.
///
- /// The failure mechanism containing at least one profile.
+ /// The failure mechanism containing .
/// The profile residing in
/// that should be removed.
/// All observable objects affected by this method.
- /// Thrown when
+ /// Thrown when
/// or is null.
public static IEnumerable RemoveForeshoreProfile(StabilityStoneCoverFailureMechanism failureMechanism, ForeshoreProfile profile)
{
@@ -437,11 +409,11 @@
/// Removes a given from the
/// and clears all data that depends on it, either directly or indirectly.
///
- /// The failure mechanism containing at least one profile.
+ /// The failure mechanism containing .
/// The profile residing in
/// that should be removed.
/// All observable objects affected by this method.
- /// Thrown when
+ /// Thrown when
/// or is null.
public static IEnumerable RemoveForeshoreProfile(WaveImpactAsphaltCoverFailureMechanism failureMechanism, ForeshoreProfile profile)
{
@@ -471,11 +443,11 @@
/// Removes a given from the
/// and clears all data that depends on it, either directly or indirectly.
///
- /// The failure mechanism containing at least one profile.
+ /// The failure mechanism containing .
/// The profile residing in
/// that should be removed.
/// All observable objects affected by this method.
- /// Thrown when
+ /// Thrown when
/// or is null.
public static IEnumerable RemoveForeshoreProfile(GrassCoverErosionOutwardsFailureMechanism failureMechanism, ForeshoreProfile profile)
{
@@ -505,11 +477,11 @@
/// Removes a given from the
/// and clears all data that depends on it, either directly or indirectly.
///
- /// The failure mechanism containing at least one profile.
+ /// The failure mechanism containing .
/// The profile residing in
/// that should be removed.
/// All observable objects affected by this method.
- /// Thrown when
+ /// Thrown when
/// or is null.
public static IEnumerable RemoveDikeProfile(GrassCoverErosionInwardsFailureMechanism failureMechanism, DikeProfile profile)
{
@@ -532,7 +504,7 @@
foreach (GrassCoverErosionInwardsCalculation calculation in calculationWithRemovedDikeProfile)
{
calculation.InputParameters.DikeProfile = null;
- IEnumerable changedSectionResults =
+ IEnumerable changedSectionResults =
GrassCoverErosionInwardsHelper.Delete(failureMechanism.SectionResults, calculation, calculations);
foreach (GrassCoverErosionInwardsFailureMechanismSectionResult result in changedSectionResults)
{