Index: Ringtoets.sln =================================================================== diff -u -r1d6af127c4b44cf6fd17bd6848b5e2512e550a44 -r5f61c64020ac01999b88a49cc70eafba7134e450 --- Ringtoets.sln (.../Ringtoets.sln) (revision 1d6af127c4b44cf6fd17bd6848b5e2512e550a44) +++ Ringtoets.sln (.../Ringtoets.sln) (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -1911,7 +1911,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{7504E03B-CF6B-4071-BDCD-E93BF55BD811}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Riskeer.Storage.Core", "Ringtoets\Storage\src\Ringtoets.Storage.Core\Riskeer.Storage.Core.csproj", "{50963F12-448C-41BA-A62C-CDB0AB8D21E0}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Riskeer.Storage.Core", "Ringtoets\Storage\src\Riskeer.Storage.Core\Riskeer.Storage.Core.csproj", "{50963F12-448C-41BA-A62C-CDB0AB8D21E0}" ProjectSection(ProjectDependencies) = postProject {C90B77DA-E421-43CC-B82E-529651BC21AC} = {C90B77DA-E421-43CC-B82E-529651BC21AC} EndProjectSection Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/App.config'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/BackedUpFileWriter.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/BackgroundDataIdentifiers.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/BackgroundDataType.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/ColorConversionExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/AssessmentSectionCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/BackgroundDataCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/CalculationGroupCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/ClosingStructures/ClosingStructureCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/ClosingStructures/ClosingStructuresFailureMechanismCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/ClosingStructures/ClosingStructuresFailureMechanismSectionResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/DuneErosion/DuneErosionFailureMechanismCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/DuneErosion/DuneErosionFailureMechanismSectionResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/DuneErosion/DuneLocationCalculationCollectionCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/DuneErosion/DuneLocationCalculationCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/DuneErosion/DuneLocationCalculationOutputCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/DuneErosion/DuneLocationCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/FailureMechanismCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/FailureMechanismSectionCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/ForeshoreProfileCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/GrassCoverErosionInwards/DikeHeightOutputCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/GrassCoverErosionInwards/DikeProfileCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismSectionResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsOutputCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/GrassCoverErosionInwards/OvertoppingRateOutputCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismSectionResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsCalculationCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/GrassCoverSlipOffInwards/GrassCoverSlipOffInwardsFailureMechanismCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/GrassCoverSlipOffInwards/GrassCoverSlipOffInwardsFailureMechanismSectionResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/GrassCoverSlipOffOutwards/GrassCoverSlipOffOutwardsFailureMechanismCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/GrassCoverSlipOffOutwards/GrassCoverSlipOffOutwardsFailureMechanismSectionResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/HeightStructures/HeightStructureCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/HeightStructures/HeightStructuresFailureMechanismCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/HeightStructures/HeightStructuresFailureMechanismSectionResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/HydraulicBoundaryLocationCalculationCollectionCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/HydraulicBoundaryLocationCalculationCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/HydraulicBoundaryLocationCalculationOutputCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/HydraulicBoundaryLocationCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/HydraulicLocationConfigurationSettingsCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/IllustrationPoints/GeneralResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/IllustrationPoints/IllustrationPointNodeCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/IllustrationPoints/IllustrationPointResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/IllustrationPoints/StochastCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/IllustrationPoints/SubMechanismIllustrationPointCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/IllustrationPoints/SubMechanismIllustrationPointStochastCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/IllustrationPoints/TopLevelFaultTreeIllustrationPointCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/IllustrationPoints/TopLevelSubMechanismIllustrationPointCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsCalculationScenarioCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsFailureMechanismCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsFailureMechanismSectionResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsOutputCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsPreconsolidationStressCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer1DCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer2DCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSoilProfile1DCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSoilProfile2DCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilModelCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSurfaceLineCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/MacrostabilityOutwards/MacroStabilityOutwardsFailureMechanismCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/MacrostabilityOutwards/MacroStabilityOutwardsFailureMechanismSectionResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/Microstability/MicrostabilityFailureMechanismCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/Microstability/MicrostabilityFailureMechanismSectionResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/PersistenceRegistry.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/Piping/PipingCalculationScenarioCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/Piping/PipingFailureMechanismCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/Piping/PipingFailureMechanismSectionResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/Piping/PipingOutputCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/Piping/PipingSoilLayerCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/Piping/PipingSoilProfileCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/Piping/PipingStochasticSoilModelCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/Piping/PipingStochasticSoilProfileCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/Piping/PipingSurfaceLineCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/PipingStructure/PipingStructureFailureMechanismCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/PipingStructure/PipingStructureFailureMechanismSectionResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/RiskeerProjectCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/StabilityPointStructures/StabilityPointStructureCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/StabilityPointStructures/StabilityPointStructuresFailureMechanismCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/StabilityPointStructures/StabilityPointStructuresFailureMechanismSectionResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/StabilityStoneCover/StabilityStoneCoverFailureMechanismCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/StabilityStoneCover/StabilityStoneCoverFailureMechanismSectionResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/StabilityStoneCover/StabilityStoneCoverWaveConditionsCalculationCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/StrengthStabilityLengthwise/StrengthStabilityLengthwiseConstructionFailureMechanismCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/StrengthStabilityLengthwise/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/StructuresCalculationCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/StructuresOutputCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/TechnicalInnovation/TechnicalInnovationFailureMechanismCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/TechnicalInnovation/TechnicalInnovationFailureMechanismSectionResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/WaterPressureAsphaltCover/WaterPressureAsphaltCoverFailureMechanismCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/WaterPressureAsphaltCover/WaterPressureAsphaltCoverFailureMechanismSectionResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/WaveConditionsOutputCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverFailureMechanismCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverFailureMechanismSectionResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsCalculationCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/AssessmentSectionEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/BackgroundDataEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/BackgroundDataMetaEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/CalculationGroupEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/ClosingStructureEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/ClosingStructuresCalculationEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/ClosingStructuresFailureMechanismMetaEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/ClosingStructuresOutputEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/ClosingStructuresSectionResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/DikeProfileEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/DuneErosionFailureMechanismMetaEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/DuneErosionSectionResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/DuneLocationCalculationCollectionEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/DuneLocationCalculationEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/DuneLocationCalculationOutputEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/DuneLocationEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/FailureMechanismEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/FailureMechanismSectionEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/FailureMechanismType.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/FaultTreeIllustrationPointEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/ForeshoreProfileEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/GeneralResultFaultTreeIllustrationPointEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/GeneralResultSubMechanismIllustrationPointEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/GrassCoverErosionInwardsCalculationEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/GrassCoverErosionInwardsDikeHeightOutputEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/GrassCoverErosionInwardsFailureMechanismMetaEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/GrassCoverErosionInwardsOutputEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/GrassCoverErosionInwardsOvertoppingRateOutputEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/GrassCoverErosionInwardsSectionResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/GrassCoverErosionOutwardsFailureMechanismMetaEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/GrassCoverErosionOutwardsSectionResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/GrassCoverErosionOutwardsWaveConditionsCalculationEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/GrassCoverErosionOutwardsWaveConditionsOutputEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/GrassCoverSlipOffInwardsSectionResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/GrassCoverSlipOffOutwardsSectionResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/HeightStructureEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/HeightStructuresCalculationEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/HeightStructuresFailureMechanismMetaEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/HeightStructuresOutputEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/HeightStructuresSectionResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/HydraulicBoundaryDatabaseEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/HydraulicLocationCalculationCollectionEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/HydraulicLocationCalculationEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/HydraulicLocationEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/HydraulicLocationOutputEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/HydraulicLocationOutputType.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/IGeneralResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/IHasGeneralResultFaultTreeIllustrationPointEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/IStructuresCalculationEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/IStructuresOutputEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/IllustrationPointResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/MacroStabilityInwardsCalculationEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/MacroStabilityInwardsCalculationOutputEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/MacroStabilityInwardsCharacteristicPointEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/MacroStabilityInwardsCharacteristicPointType.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/MacroStabilityInwardsFailureMechanismMetaEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/MacroStabilityInwardsPreconsolidationStressEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/MacroStabilityInwardsSectionResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/MacroStabilityInwardsSoilLayerOneDEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/MacroStabilityInwardsSoilLayerTwoDEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/MacroStabilityInwardsSoilProfileOneDEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/MacroStabilityInwardsSoilProfileTwoDEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/MacroStabilityInwardsStochasticSoilProfileEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/MacroStabilityOutwardsFailureMechanismMetaEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/MacroStabilityOutwardsSectionResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/MicrostabilitySectionResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/PartialClosingStructuresCalculationEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/PartialClosingStructuresOutputEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/PartialGeneralResultFaultTreeIllustrationPointEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/PartialGeneralResultSubMechanismIllustrationPointEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/PartialHeightStructuresCalculationEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/PartialHeightStructuresOutputEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/PartialRiskeerEntities.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/PartialStabilityPointStructuresCalculationEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/PartialStabilityPointStructuresOutputEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/PipingCalculationEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/PipingCalculationOutputEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/PipingCharacteristicPointEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/PipingCharacteristicPointType.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/PipingFailureMechanismMetaEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/PipingSectionResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/PipingSoilLayerEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/PipingSoilProfileEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/PipingStochasticSoilProfileEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/PipingStructureFailureMechanismMetaEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/PipingStructureSectionResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/ProjectEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/RiskeerEntities.Context.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/RiskeerEntities.Context.tt'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/RiskeerEntities.Designer.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/RiskeerEntities.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/RiskeerEntities.edmx'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/RiskeerEntities.edmx.diagram'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/RiskeerEntities.tt'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/StabilityPointStructureEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/StabilityPointStructuresCalculationEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/StabilityPointStructuresFailureMechanismMetaEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/StabilityPointStructuresOutputEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/StabilityPointStructuresSectionResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/StabilityStoneCoverFailureMechanismMetaEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/StabilityStoneCoverSectionResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/StabilityStoneCoverWaveConditionsCalculationEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/StabilityStoneCoverWaveConditionsOutputEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/StochastEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/StochasticSoilModelEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/StrengthStabilityLengthwiseConstructionSectionResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/SubMechanismIllustrationPointEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/SubMechanismIllustrationPointStochastEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/SurfaceLineEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/TechnicalInnovationSectionResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/TopLevelFaultTreeIllustrationPointEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/TopLevelSubMechanismIllustrationPointEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/VersionEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/WaterPressureAsphaltCoverSectionResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/WaveConditionsOutputType.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/WaveImpactAsphaltCoverFailureMechanismMetaEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/WaveImpactAsphaltCoverSectionResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/WaveImpactAsphaltCoverWaveConditionsCalculationEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DbContext/WaveImpactAsphaltCoverWaveConditionsOutputEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/DoubleConversionExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Exceptions/CannotDeleteBackupFileException.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Exceptions/CannotDetermineFingerprintException.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Exceptions/EntityNotFoundException.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/FingerprintHelper.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Properties/AssemblyInfo.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Properties/Resources.Designer.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Properties/Resources.resx'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/AssessmentSectionEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/BackgroundDataEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/BackgroundDataMetaEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/CalculationGroupEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/ClosingStructures/ClosingStructureEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/ClosingStructures/ClosingStructuresCalculationEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/ClosingStructures/ClosingStructuresFailureMechanismMetaEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/ClosingStructures/ClosingStructuresSectionResultEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/DuneErosion/DuneErosionFailureMechanismMetaEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/DuneErosion/DuneErosionSectionResultEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/DuneErosion/DuneLocationCalculationCollectionEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/DuneErosion/DuneLocationCalculationEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/DuneErosion/DuneLocationCalculationOutputEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/DuneErosion/DuneLocationEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/FailureMechanismEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/FailureMechanismSectionEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/ForeshoreProfileEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/GrassCoverErosionInwards/DikeProfileEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsDikeHeightOutputEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismMetaEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsOutputEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsOvertoppingRateOutputEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsSectionResultEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/GrassCoverErosionOutwards/GrassCoverErosionInwardsFailureMechanismMetaEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsSectionResultEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsCalculationEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsOutputEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/GrassCoverSlipOffInwardsSectionResultEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/GrassCoverSlipOffOutwardsSectionResultEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/HeightStructures/HeightStructureEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/HeightStructures/HeightStructuresCalculationEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/HeightStructures/HeightStructuresFailureMechanismMetaEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/HeightStructures/HeightStructuresSectionResultEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/HydraulicBoundaryDatabaseEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/HydraulicLocationCalculationCollectionReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/HydraulicLocationCalculationEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/HydraulicLocationEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/HydraulicLocationOutputEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/IllustrationPoints/FaultTreeIllustrationPointEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/IllustrationPoints/GeneralResultFaultTreeIllustrationPointEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/IllustrationPoints/GeneralResultSubMechanismIllustrationPointEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/IllustrationPoints/IllustrationPointResultEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/IllustrationPoints/StochastEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/IllustrationPoints/SubMechanismIllustrationPointEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/IllustrationPoints/SubMechanismIllustrationPointStochastEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/IllustrationPoints/TopLevelFaultTreeIllustrationPointEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/IllustrationPoints/TopLevelSubMechanismIllustrationPointReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsCalculationEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsCalculationOutputEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsFailureMechanismMetaEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsPreconsolidationStressEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsSectionResultEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsSoilLayerOneDEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsSoilLayerTwoDEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsSoilProfileOneDEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsSoilProfileTwoDEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/MacroStabilityOutwards/MacroStabilityOutwardsFailureMechanismMetaEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/MacroStabilityOutwards/MacroStabilityOutwardsSectionResultEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/MicrostabilitySectionResultEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/Piping/PipingCalculationEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/Piping/PipingCalculationOutputEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/Piping/PipingFailureMechanismMetaEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/Piping/PipingSectionResultEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/Piping/PipingSoilLayerEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/Piping/PipingSoilProfileEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/Piping/PipingStochasticSoilProfileEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/PipingStructure/PipingStructureSectionResultEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/ProjectEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/ReadConversionCollector.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/StabilityPointStructures/StabilityPointStructureEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/StabilityPointStructures/StabilityPointStructureFailureMechanismMetaEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/StabilityPointStructures/StabilityPointStructuresCalculationEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/StabilityPointStructures/StabilityPointStructuresSectionResultEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/StabilityStoneCover/StabilityStoneCoverFailureMechanismMetaEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/StabilityStoneCover/StabilityStoneCoverSectionResultEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/StabilityStoneCover/StabilityStoneCoverWaveConditionsCalculationEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/StabilityStoneCover/StabilityStoneCoverWaveConditionsOutputEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/StochasticSoilModelEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/StructureCalculationEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/SurfaceLineEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/TechnicalInnovationSectionResultEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/WaterPressureAsphaltCoverSectionResultEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/WaveImpactAsphaltCover/WaveImpactAsphaltCoverFailureMechanismMetaEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/WaveImpactAsphaltCover/WaveImpactAsphaltCoverSectionResultEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsCalculationEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsOutputEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Storage/src/Ringtoets.Storage.Core/Ringtoets.rtd =================================================================== diff -u -r12c71fcdd358a10e875edfa2288e545e02547d63 -r5f61c64020ac01999b88a49cc70eafba7134e450 Binary files differ Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Riskeer.Storage.Core.csproj'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/RoundedDoubleConversionExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Serializers/DataCollectionSerializer.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Serializers/MacroStabilityInwardsSliceCollectionXmlSerializer.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Serializers/Point2DCollectionXmlSerializer.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Serializers/Point3DCollectionXmlSerializer.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Serializers/RoughnessPointCollectionXmlSerializer.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Serializers/TangentLineCollectionXmlSerializer.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/SqLiteEntityConnectionStringBuilder.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/StorageSqLite.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/StorageSqliteCreator.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5f61c64020ac01999b88a49cc70eafba7134e450 refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/packages.config'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Storage/src/Riskeer.Storage.Core/App.config =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/App.config (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/App.config (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,40 @@ + + + + +
+ + + + + + + + + + + + + + \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/BackedUpFileWriter.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/BackedUpFileWriter.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/BackedUpFileWriter.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,238 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.IO; +using Core.Common.Util; +using Ringtoets.Storage.Core.Exceptions; +using Ringtoets.Storage.Core.Properties; + +namespace Ringtoets.Storage.Core +{ + /// + /// Class for providing a safe way of writing files by creating a temporary backup file of targeted files. + /// + public class BackedUpFileWriter + { + private const string temporarySuffix = "~"; + + private readonly string temporaryFilePath; + private readonly string targetFilePath; + private bool isTemporaryFileCreated; + + /// + /// Creates an instance of . + /// + /// The path of the file which will be overwritten. + /// is not a valid path. + public BackedUpFileWriter(string targetFilePath) + { + IOUtils.ValidateFilePath(targetFilePath); + + this.targetFilePath = targetFilePath; + temporaryFilePath = targetFilePath + temporarySuffix; + } + + /// + /// Performs the in a safe way by backing up the targeted file provided when + /// constructing the . It is expected that the + /// will throw an exception when the operation fails, so that the backed up target file can be restored. + /// + /// The action to perform after backing up the targeted file. + /// Thrown when: + /// + /// The temporary file already exists and cannot be deleted. + /// The temporary file cannot be created from the target file. + /// When reverting, the original file cannot be restored. + /// + /// + /// Thrown when cleaning up, the temporary file cannot be removed. + /// Any thrown by will be rethrown. + public void Perform(Action writeAction) + { + CreateTemporaryFile(); + + try + { + writeAction(); + } + catch + { + Revert(); + throw; + } + + Finish(); + } + + /// + /// Removes the temporary file if it was created. + /// + /// The temporary file cannot be removed. + private void Finish() + { + if (isTemporaryFileCreated) + { + DeleteTemporaryFile(); + } + } + + /// + /// Reverts the target file to the temporary file if it was created. If the operation fails, + /// the temporary file will remain in the directory of the target file. + /// + /// The original file cannot be restored. + private void Revert() + { + if (isTemporaryFileCreated) + { + RestoreOriginalFile(); + } + } + + /// + /// Creates a temporary file from the target file, if there is any. Creates a new file at the target + /// file path. + /// + /// Thrown when either: + /// + /// The temporary file already exists and cannot be deleted. + /// The temporary file cannot be created from the target file. + /// + /// + private void CreateTemporaryFile() + { + isTemporaryFileCreated = false; + + if (File.Exists(targetFilePath)) + { + RemoveAlreadyExistingTemporaryFile(); + CreateNewTemporaryFile(); + isTemporaryFileCreated = true; + } + } + + /// + /// Removes the temporary file for the target file if it already exists. + /// + /// The temporary file already exists and cannot be deleted. + private void RemoveAlreadyExistingTemporaryFile() + { + if (File.Exists(temporaryFilePath)) + { + try + { + File.Delete(temporaryFilePath); + } + catch (Exception e) + { + if (e is ArgumentException || e is IOException || e is NotSupportedException || e is UnauthorizedAccessException) + { + string message = string.Format( + Resources.SafeOverwriteFileHelper_RemoveAlreadyExistingTemporaryFile_Already_existing_temporary_file_at_FilePath_0_could_not_be_removed, + temporaryFilePath); + throw new IOException(message, e); + } + + throw; + } + } + } + + /// + /// Creates a temporary file from the target file. + /// + /// The temporary file cannot be created from the target file. + private void CreateNewTemporaryFile() + { + try + { + File.Move(targetFilePath, temporaryFilePath); + } + catch (Exception e) + { + if (e is ArgumentException || e is IOException || e is UnauthorizedAccessException || e is NotSupportedException) + { + string message = string.Format( + Resources.SafeOverwriteFileHelper_CreateNewTemporaryFile_Cannot_create_temporary_FilePath_0_Try_change_save_location, + targetFilePath); + throw new IOException(message, e); + } + + throw; + } + } + + /// + /// Moves the temporary file back to the original path. If the operation fails, the temporary file + /// will remain. + /// + /// Thrown when either: + /// + /// The new file could not be deleted. + /// The temporary file could not be moved to its original place. + /// + private void RestoreOriginalFile() + { + try + { + File.Delete(targetFilePath); + File.Move(temporaryFilePath, targetFilePath); + } + catch (Exception e) + { + if (e is ArgumentException || e is IOException || e is NotSupportedException || e is UnauthorizedAccessException) + { + string message = string.Format( + Resources.SafeOverwriteFileHelper_RestoreOriginalFile_Cannot_revert_to_original_FilePath_0_Try_reverting_manually, + targetFilePath); + throw new IOException(message, e); + } + + throw; + } + } + + /// + /// Deletes the created temporary file. + /// + /// The temporary file cannot be removed. + private void DeleteTemporaryFile() + { + try + { + File.Delete(temporaryFilePath); + } + catch (Exception e) + { + if (e is ArgumentException || e is IOException || e is NotSupportedException || e is UnauthorizedAccessException) + { + string message = string.Format( + Resources.SafeOverwriteFileHelper_DeleteTemporaryFile_Cannot_remove_temporary_FilePath_0_Try_removing_manually, + temporaryFilePath); + throw new CannotDeleteBackupFileException(message, e); + } + + throw; + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/BackgroundDataIdentifiers.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/BackgroundDataIdentifiers.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/BackgroundDataIdentifiers.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,54 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +namespace Ringtoets.Storage.Core +{ + /// + /// Container of general identifiers related to background data. + /// + public static class BackgroundDataIdentifiers + { + /// + /// The identifier for the configured state. + /// + public const string IsConfigured = "IsConfigured"; + + /// + /// The identifier for the source capabilities url. + /// + public const string SourceCapabilitiesUrl = "SourceCapabilitiesUrl"; + + /// + /// The identifier for the selected capability identifier. + /// + public const string SelectedCapabilityIdentifier = "SelectedCapabilityIdentifier"; + + /// + /// The identifier for the preferred format. + /// + public const string PreferredFormat = "PreferredFormat"; + + /// + /// The identifier for the well known tile source. + /// + public const string WellKnownTileSource = "WellKnownTileSource"; + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/BackgroundDataType.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/BackgroundDataType.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/BackgroundDataType.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,41 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using Ringtoets.Common.Data.AssessmentSection; + +namespace Ringtoets.Storage.Core +{ + /// + /// Enumeration that defines the possible types of a . + /// + public enum BackgroundDataType + { + /// + /// Web Map Tile Service background data type. + /// + Wmts = 1, + + /// + /// Well known tile source background data type. + /// + WellKnown = 2 + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/ColorConversionExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/ColorConversionExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/ColorConversionExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,56 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Drawing; + +namespace Ringtoets.Storage.Core +{ + /// + /// Class that contains extension methods for to convert them to + /// other value types. + /// + internal static class ColorConversionExtensions + { + /// + /// Convert to its 64-bit ARGB value. + /// + /// The value to convert. + /// The 64-bit ARGB value, or null when the + /// color is empty. + public static long? ToInt64(this Color value) + { + return value.IsEmpty + ? (long?) null + : value.ToArgb(); + } + + /// + /// Converts a 32-bit ARGB value to . + /// + /// The 32-bit ARGB value to convert. + /// The created . + public static Color ToColor(this long? value) + { + return value == null ? Color.Empty : Color.FromArgb(Convert.ToInt32(value)); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/AssessmentSectionCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/AssessmentSectionCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/AssessmentSectionCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,147 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Linq; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.Contribution; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Integration.Data; +using Ringtoets.Storage.Core.Create.ClosingStructures; +using Ringtoets.Storage.Core.Create.DuneErosion; +using Ringtoets.Storage.Core.Create.GrassCoverErosionInwards; +using Ringtoets.Storage.Core.Create.GrassCoverErosionOutwards; +using Ringtoets.Storage.Core.Create.GrassCoverSlipOffInwards; +using Ringtoets.Storage.Core.Create.GrassCoverSlipOffOutwards; +using Ringtoets.Storage.Core.Create.HeightStructures; +using Ringtoets.Storage.Core.Create.MacroStabilityInwards; +using Ringtoets.Storage.Core.Create.MacroStabilityOutwards; +using Ringtoets.Storage.Core.Create.Microstability; +using Ringtoets.Storage.Core.Create.Piping; +using Ringtoets.Storage.Core.Create.PipingStructure; +using Ringtoets.Storage.Core.Create.StabilityPointStructures; +using Ringtoets.Storage.Core.Create.StabilityStoneCover; +using Ringtoets.Storage.Core.Create.StrengthStabilityLengthwise; +using Ringtoets.Storage.Core.Create.TechnicalInnovation; +using Ringtoets.Storage.Core.Create.WaterPressureAsphaltCover; +using Ringtoets.Storage.Core.Create.WaveImpactAsphaltCover; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Serializers; + +namespace Ringtoets.Storage.Core.Create +{ + /// + /// Extension methods for related to creating an . + /// + internal static class AssessmentSectionCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The section to create a database entity for. + /// The object keeping track of create operations. + /// The index at which resides in its parent. + /// A new . + /// Thrown when is null. + internal static AssessmentSectionEntity Create(this AssessmentSection section, PersistenceRegistry registry, int order) + { + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + FailureMechanismContribution contribution = section.FailureMechanismContribution; + var entity = new AssessmentSectionEntity + { + Id = section.Id.DeepClone(), + Name = section.Name.DeepClone(), + Composition = Convert.ToByte(section.Composition), + Comments = section.Comments.Body.DeepClone(), + LowerLimitNorm = contribution.LowerLimitNorm, + SignalingNorm = contribution.SignalingNorm, + NormativeNormType = Convert.ToByte(contribution.NormativeNorm), + Order = order + }; + + AddEntityForHydraulicDatabase(section.HydraulicBoundaryDatabase, entity, registry); + AddHydraulicLocationCalculationEntities(section, entity, registry); + AddEntityForReferenceLine(section, entity); + + entity.BackgroundDataEntities.Add(section.BackgroundData.Create()); + + entity.FailureMechanismEntities.Add(section.Piping.Create(registry)); + entity.FailureMechanismEntities.Add(section.GrassCoverErosionInwards.Create(registry)); + entity.FailureMechanismEntities.Add(section.HeightStructures.Create(registry)); + entity.FailureMechanismEntities.Add(section.StrengthStabilityLengthwiseConstruction.Create(registry)); + entity.FailureMechanismEntities.Add(section.TechnicalInnovation.Create(registry)); + entity.FailureMechanismEntities.Add(section.WaterPressureAsphaltCover.Create(registry)); + entity.FailureMechanismEntities.Add(section.ClosingStructures.Create(registry)); + entity.FailureMechanismEntities.Add(section.MacroStabilityInwards.Create(registry)); + entity.FailureMechanismEntities.Add(section.MacroStabilityOutwards.Create(registry)); + entity.FailureMechanismEntities.Add(section.WaveImpactAsphaltCover.Create(registry)); + entity.FailureMechanismEntities.Add(section.GrassCoverErosionOutwards.Create(registry)); + entity.FailureMechanismEntities.Add(section.GrassCoverSlipOffInwards.Create(registry)); + entity.FailureMechanismEntities.Add(section.GrassCoverSlipOffOutwards.Create(registry)); + entity.FailureMechanismEntities.Add(section.Microstability.Create(registry)); + entity.FailureMechanismEntities.Add(section.PipingStructure.Create(registry)); + entity.FailureMechanismEntities.Add(section.StabilityStoneCover.Create(registry)); + entity.FailureMechanismEntities.Add(section.DuneErosion.Create(registry)); + entity.FailureMechanismEntities.Add(section.StabilityPointStructures.Create(registry)); + + return entity; + } + + private static void AddEntityForReferenceLine(AssessmentSection section, AssessmentSectionEntity entity) + { + if (section.ReferenceLine.Points.Any()) + { + entity.ReferenceLinePointXml = new Point2DCollectionXmlSerializer().ToXml(section.ReferenceLine.Points); + } + } + + private static void AddEntityForHydraulicDatabase(HydraulicBoundaryDatabase hydraulicBoundaryDatabase, AssessmentSectionEntity entity, PersistenceRegistry registry) + { + if (hydraulicBoundaryDatabase.IsLinked()) + { + entity.HydraulicBoundaryDatabaseEntities.Add(hydraulicBoundaryDatabase.Create()); + + for (var i = 0; i < hydraulicBoundaryDatabase.Locations.Count; i++) + { + HydraulicBoundaryLocation hydraulicBoundaryLocation = hydraulicBoundaryDatabase.Locations[i]; + entity.HydraulicLocationEntities.Add(hydraulicBoundaryLocation.Create(registry, i)); + } + } + } + + private static void AddHydraulicLocationCalculationEntities(AssessmentSection assessmentSection, AssessmentSectionEntity entity, PersistenceRegistry registry) + { + entity.HydraulicLocationCalculationCollectionEntity7 = assessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm.Create(registry); + entity.HydraulicLocationCalculationCollectionEntity6 = assessmentSection.WaterLevelCalculationsForSignalingNorm.Create(registry); + entity.HydraulicLocationCalculationCollectionEntity5 = assessmentSection.WaterLevelCalculationsForLowerLimitNorm.Create(registry); + entity.HydraulicLocationCalculationCollectionEntity4 = assessmentSection.WaterLevelCalculationsForFactorizedLowerLimitNorm.Create(registry); + + entity.HydraulicLocationCalculationCollectionEntity3 = assessmentSection.WaveHeightCalculationsForFactorizedSignalingNorm.Create(registry); + entity.HydraulicLocationCalculationCollectionEntity2 = assessmentSection.WaveHeightCalculationsForSignalingNorm.Create(registry); + entity.HydraulicLocationCalculationCollectionEntity1 = assessmentSection.WaveHeightCalculationsForLowerLimitNorm.Create(registry); + entity.HydraulicLocationCalculationCollectionEntity = assessmentSection.WaveHeightCalculationsForFactorizedLowerLimitNorm.Create(registry); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/BackgroundDataCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/BackgroundDataCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/BackgroundDataCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,114 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create +{ + /// + /// Extensions methods for related to + /// creating a . + /// + internal static class BackgroundDataCreateExtensions + { + /// + /// Creates a based on the information of the + /// . + /// + /// The container to create a for. + /// The created . + internal static BackgroundDataEntity Create(this BackgroundData backgroundData) + { + if (backgroundData == null) + { + throw new ArgumentNullException(nameof(backgroundData)); + } + + var entity = new BackgroundDataEntity + { + Name = backgroundData.Name.DeepClone(), + IsVisible = Convert.ToByte(backgroundData.IsVisible), + Transparency = backgroundData.Transparency + }; + + AddEntitiesForBackgroundDataMeta(backgroundData, entity); + + return entity; + } + + private static void AddEntitiesForBackgroundDataMeta(BackgroundData backgroundData, BackgroundDataEntity entity) + { + var wmtsBackgroundDataConfiguration = backgroundData.Configuration as WmtsBackgroundDataConfiguration; + var wellKnownBackgroundDataConfiguration = backgroundData.Configuration as WellKnownBackgroundDataConfiguration; + + if (wmtsBackgroundDataConfiguration != null) + { + entity.BackgroundDataType = Convert.ToByte(BackgroundDataType.Wmts); + AddWmtsMetaEntities(wmtsBackgroundDataConfiguration, entity); + } + else if (wellKnownBackgroundDataConfiguration != null) + { + entity.BackgroundDataType = Convert.ToByte(BackgroundDataType.WellKnown); + AddWellKnownTileSourceMetaEntities(wellKnownBackgroundDataConfiguration, entity); + } + } + + private static void AddWellKnownTileSourceMetaEntities(WellKnownBackgroundDataConfiguration wellKnownConfiguration, BackgroundDataEntity entity) + { + entity.BackgroundDataMetaEntities.Add(new BackgroundDataMetaEntity + { + Key = BackgroundDataIdentifiers.WellKnownTileSource.DeepClone(), + Value = ((int) wellKnownConfiguration.WellKnownTileSource).ToString() + }); + } + + private static void AddWmtsMetaEntities(WmtsBackgroundDataConfiguration wmtsBackgroundDataConfiguration, BackgroundDataEntity entity) + { + entity.BackgroundDataMetaEntities.Add(new BackgroundDataMetaEntity + { + Key = BackgroundDataIdentifiers.IsConfigured, + Value = Convert.ToByte(wmtsBackgroundDataConfiguration.IsConfigured).ToString() + }); + + if (wmtsBackgroundDataConfiguration.IsConfigured) + { + entity.BackgroundDataMetaEntities.Add(new BackgroundDataMetaEntity + { + Key = BackgroundDataIdentifiers.SelectedCapabilityIdentifier.DeepClone(), + Value = wmtsBackgroundDataConfiguration.SelectedCapabilityIdentifier.DeepClone() + }); + entity.BackgroundDataMetaEntities.Add(new BackgroundDataMetaEntity + { + Key = BackgroundDataIdentifiers.SourceCapabilitiesUrl.DeepClone(), + Value = wmtsBackgroundDataConfiguration.SourceCapabilitiesUrl.DeepClone() + }); + entity.BackgroundDataMetaEntities.Add(new BackgroundDataMetaEntity + { + Key = BackgroundDataIdentifiers.PreferredFormat.DeepClone(), + Value = wmtsBackgroundDataConfiguration.PreferredFormat.DeepClone() + }); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/CalculationGroupCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/CalculationGroupCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/CalculationGroupCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,143 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.ClosingStructures.Data; +using Ringtoets.Common.Data.Calculation; +using Ringtoets.Common.Data.Structures; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.GrassCoverErosionOutwards.Data; +using Ringtoets.HeightStructures.Data; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.Piping.Data; +using Ringtoets.StabilityPointStructures.Data; +using Ringtoets.StabilityStoneCover.Data; +using Ringtoets.Storage.Core.Create.GrassCoverErosionInwards; +using Ringtoets.Storage.Core.Create.GrassCoverErosionOutwards; +using Ringtoets.Storage.Core.Create.MacroStabilityInwards; +using Ringtoets.Storage.Core.Create.Piping; +using Ringtoets.Storage.Core.Create.StabilityStoneCover; +using Ringtoets.Storage.Core.Create.WaveImpactAsphaltCover; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.WaveImpactAsphaltCover.Data; + +namespace Ringtoets.Storage.Core.Create +{ + /// + /// Extension methods for related to creating a . + /// + internal static class CalculationGroupCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The calculation group to create a database entity for. + /// The object keeping track of create operations. + /// The index at which resides within its parent. + /// A new . + /// Thrown when is null. + internal static CalculationGroupEntity Create(this CalculationGroup group, PersistenceRegistry registry, int order) + { + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var entity = new CalculationGroupEntity + { + Name = group.Name.DeepClone(), + Order = order + }; + CreateChildElements(group, entity, registry); + + return entity; + } + + private static void CreateChildElements(CalculationGroup parentGroup, CalculationGroupEntity entity, PersistenceRegistry registry) + { + for (var i = 0; i < parentGroup.Children.Count; i++) + { + ICalculationBase calculationBase = parentGroup.Children[i]; + + var childGroup = calculationBase as CalculationGroup; + if (childGroup != null) + { + entity.CalculationGroupEntity1.Add(childGroup.Create(registry, i)); + } + + var childPipingCalculation = calculationBase as PipingCalculationScenario; + if (childPipingCalculation != null) + { + entity.PipingCalculationEntities.Add(childPipingCalculation.Create(registry, i)); + } + + var childMacroStabilityInwardsCalculation = calculationBase as MacroStabilityInwardsCalculationScenario; + if (childMacroStabilityInwardsCalculation != null) + { + entity.MacroStabilityInwardsCalculationEntities.Add(childMacroStabilityInwardsCalculation.Create(registry, i)); + } + + var childGrassCoverErosionInwardsCalculation = calculationBase as GrassCoverErosionInwardsCalculation; + if (childGrassCoverErosionInwardsCalculation != null) + { + entity.GrassCoverErosionInwardsCalculationEntities.Add(childGrassCoverErosionInwardsCalculation.Create(registry, i)); + } + + var childGrassCoverErosionOutwardsCalculation = calculationBase as GrassCoverErosionOutwardsWaveConditionsCalculation; + if (childGrassCoverErosionOutwardsCalculation != null) + { + entity.GrassCoverErosionOutwardsWaveConditionsCalculationEntities.Add(childGrassCoverErosionOutwardsCalculation.Create(registry, i)); + } + + var childHeightStructuresCalculation = calculationBase as StructuresCalculation; + if (childHeightStructuresCalculation != null) + { + entity.HeightStructuresCalculationEntities.Add(childHeightStructuresCalculation.CreateForHeightStructures(registry, i)); + } + + var childClosingStructuresCalculation = calculationBase as StructuresCalculation; + if (childClosingStructuresCalculation != null) + { + entity.ClosingStructuresCalculationEntities.Add(childClosingStructuresCalculation.CreateForClosingStructures(registry, i)); + } + + var childStabilityPointStructuresCalculation = calculationBase as StructuresCalculation; + if (childStabilityPointStructuresCalculation != null) + { + entity.StabilityPointStructuresCalculationEntities.Add(childStabilityPointStructuresCalculation.CreateForStabilityPointStructures(registry, i)); + } + + var stabilityStoneCoverWaveConditionsCalculation = calculationBase as StabilityStoneCoverWaveConditionsCalculation; + if (stabilityStoneCoverWaveConditionsCalculation != null) + { + entity.StabilityStoneCoverWaveConditionsCalculationEntities.Add(stabilityStoneCoverWaveConditionsCalculation.Create(registry, i)); + } + + var waveImpactAsphaltCoverWaveConditionsCalculation = calculationBase as WaveImpactAsphaltCoverWaveConditionsCalculation; + if (waveImpactAsphaltCoverWaveConditionsCalculation != null) + { + entity.WaveImpactAsphaltCoverWaveConditionsCalculationEntities.Add(waveImpactAsphaltCoverWaveConditionsCalculation.Create(registry, i)); + } + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/ClosingStructures/ClosingStructureCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/ClosingStructures/ClosingStructureCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/ClosingStructures/ClosingStructureCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,93 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.ClosingStructures.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.ClosingStructures +{ + /// + /// Extension methods for related to creating + /// a . + /// + internal static class ClosingStructureCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The structure to create a database entity for. + /// The object keeping track of create operations. + /// The index at which resides within its parent. + /// A new . + /// Thrown when is null. + internal static ClosingStructureEntity Create(this ClosingStructure structure, PersistenceRegistry registry, int order) + { + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + if (registry.Contains(structure)) + { + return registry.Get(structure); + } + + var entity = new ClosingStructureEntity + { + Name = structure.Name.DeepClone(), + Id = structure.Id.DeepClone(), + X = structure.Location.X.ToNaNAsNull(), + Y = structure.Location.Y.ToNaNAsNull(), + StructureNormalOrientation = structure.StructureNormalOrientation.ToNaNAsNull(), + StorageStructureAreaMean = structure.StorageStructureArea.Mean.ToNaNAsNull(), + StorageStructureAreaCoefficientOfVariation = structure.StorageStructureArea.CoefficientOfVariation.ToNaNAsNull(), + AllowedLevelIncreaseStorageMean = structure.AllowedLevelIncreaseStorage.Mean.ToNaNAsNull(), + AllowedLevelIncreaseStorageStandardDeviation = structure.AllowedLevelIncreaseStorage.StandardDeviation.ToNaNAsNull(), + WidthFlowAperturesMean = structure.WidthFlowApertures.Mean.ToNaNAsNull(), + WidthFlowAperturesStandardDeviation = structure.WidthFlowApertures.StandardDeviation.ToNaNAsNull(), + LevelCrestStructureNotClosingMean = structure.LevelCrestStructureNotClosing.Mean.ToNaNAsNull(), + LevelCrestStructureNotClosingStandardDeviation = structure.LevelCrestStructureNotClosing.StandardDeviation.ToNaNAsNull(), + InsideWaterLevelMean = structure.InsideWaterLevel.Mean.ToNaNAsNull(), + InsideWaterLevelStandardDeviation = structure.InsideWaterLevel.StandardDeviation.ToNaNAsNull(), + ThresholdHeightOpenWeirMean = structure.ThresholdHeightOpenWeir.Mean.ToNaNAsNull(), + ThresholdHeightOpenWeirStandardDeviation = structure.ThresholdHeightOpenWeir.StandardDeviation.ToNaNAsNull(), + AreaFlowAperturesMean = structure.AreaFlowApertures.Mean.ToNaNAsNull(), + AreaFlowAperturesStandardDeviation = structure.AreaFlowApertures.StandardDeviation.ToNaNAsNull(), + CriticalOvertoppingDischargeMean = structure.CriticalOvertoppingDischarge.Mean.ToNaNAsNull(), + CriticalOvertoppingDischargeCoefficientOfVariation = structure.CriticalOvertoppingDischarge.CoefficientOfVariation.ToNaNAsNull(), + FlowWidthAtBottomProtectionMean = structure.FlowWidthAtBottomProtection.Mean.ToNaNAsNull(), + FlowWidthAtBottomProtectionStandardDeviation = structure.FlowWidthAtBottomProtection.StandardDeviation.ToNaNAsNull(), + ProbabilityOpenStructureBeforeFlooding = structure.ProbabilityOpenStructureBeforeFlooding.ToNaNAsNull(), + FailureProbabilityOpenStructure = structure.FailureProbabilityOpenStructure.ToNaNAsNull(), + IdenticalApertures = structure.IdenticalApertures, + FailureProbabilityReparation = structure.FailureProbabilityReparation.ToNaNAsNull(), + InflowModelType = Convert.ToByte(structure.InflowModelType), + Order = order + }; + + registry.Register(entity, structure); + + return entity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/ClosingStructures/ClosingStructuresFailureMechanismCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/ClosingStructures/ClosingStructuresFailureMechanismCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/ClosingStructures/ClosingStructuresFailureMechanismCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,104 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Util.Extensions; +using Ringtoets.ClosingStructures.Data; +using Ringtoets.Common.Data; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.ClosingStructures +{ + /// + /// Extension methods for related to creating a . + /// + internal static class ClosingStructuresFailureMechanismCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The failure mechanism to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static FailureMechanismEntity Create(this ClosingStructuresFailureMechanism mechanism, PersistenceRegistry registry) + { + FailureMechanismEntity entity = mechanism.Create(FailureMechanismType.ReliabilityClosingOfStructure, registry); + AddEntitiesForForeshoreProfiles(mechanism.ForeshoreProfiles, entity, registry); + AddEntitiesForClosingStructures(mechanism.ClosingStructures, entity, registry); + AddEntitiesForFailureMechanismMeta(mechanism, entity); + entity.CalculationGroupEntity = mechanism.CalculationsGroup.Create(registry, 0); + AddEntitiesForSectionResults(mechanism.SectionResults, registry); + + return entity; + } + + private static void AddEntitiesForSectionResults( + IEnumerable sectionResults, + PersistenceRegistry registry) + { + foreach (ClosingStructuresFailureMechanismSectionResult failureMechanismSectionResult in sectionResults) + { + ClosingStructuresSectionResultEntity sectionResultEntity = failureMechanismSectionResult.Create(registry); + FailureMechanismSectionEntity section = registry.Get(failureMechanismSectionResult.Section); + section.ClosingStructuresSectionResultEntities.Add(sectionResultEntity); + } + } + + private static void AddEntitiesForForeshoreProfiles( + ForeshoreProfileCollection foreshoreProfiles, + FailureMechanismEntity entity, + PersistenceRegistry registry) + { + for (var i = 0; i < foreshoreProfiles.Count; i++) + { + ForeshoreProfileEntity foreshoreProfileEntity = foreshoreProfiles[i].Create(registry, i); + entity.ForeshoreProfileEntities.Add(foreshoreProfileEntity); + } + } + + private static void AddEntitiesForClosingStructures( + StructureCollection structures, + FailureMechanismEntity entity, + PersistenceRegistry registry) + { + for (var i = 0; i < structures.Count; i++) + { + ClosingStructureEntity structureEntity = structures[i].Create(registry, i); + entity.ClosingStructureEntities.Add(structureEntity); + } + } + + private static void AddEntitiesForFailureMechanismMeta(ClosingStructuresFailureMechanism failureMechanism, + FailureMechanismEntity entity) + { + var metaEntity = new ClosingStructuresFailureMechanismMetaEntity + { + N2A = failureMechanism.GeneralInput.N2A, + ClosingStructureCollectionSourcePath = failureMechanism.ClosingStructures.SourcePath.DeepClone(), + ForeshoreProfileCollectionSourcePath = failureMechanism.ForeshoreProfiles.SourcePath.DeepClone() + }; + entity.ClosingStructuresFailureMechanismMetaEntities.Add(metaEntity); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/ClosingStructures/ClosingStructuresFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/ClosingStructures/ClosingStructuresFailureMechanismSectionResultCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/ClosingStructures/ClosingStructuresFailureMechanismSectionResultCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,72 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.ClosingStructures.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.ClosingStructures +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class ClosingStructuresFailureMechanismSectionResultCreateExtensions + { + /// + /// Creates a + /// based on the information of the . + /// + /// The result to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when any parameter is null. + internal static ClosingStructuresSectionResultEntity Create(this ClosingStructuresFailureMechanismSectionResult result, + PersistenceRegistry registry) + { + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var sectionResultEntity = new ClosingStructuresSectionResultEntity + { + SimpleAssessmentResult = Convert.ToByte(result.SimpleAssessmentResult), + DetailedAssessmentResult = Convert.ToByte(result.DetailedAssessmentResult), + TailorMadeAssessmentResult = Convert.ToByte(result.TailorMadeAssessmentResult), + TailorMadeAssessmentProbability = result.TailorMadeAssessmentProbability.ToNaNAsNull(), + UseManualAssembly = Convert.ToByte(result.UseManualAssembly), + ManualAssemblyProbability = result.ManualAssemblyProbability.ToNaNAsNull() + }; + if (result.Calculation != null) + { + sectionResultEntity.ClosingStructuresCalculationEntity = registry.Get(result.Calculation); + } + + return sectionResultEntity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/DuneErosion/DuneErosionFailureMechanismCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/DuneErosion/DuneErosionFailureMechanismCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/DuneErosion/DuneErosionFailureMechanismCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,88 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Ringtoets.DuneErosion.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.DuneErosion +{ + /// + /// Extension methods for related to creating a . + /// + internal static class DuneErosionFailureMechanismCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The failure mechanism to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static FailureMechanismEntity Create(this DuneErosionFailureMechanism mechanism, PersistenceRegistry registry) + { + FailureMechanismEntity entity = mechanism.Create(FailureMechanismType.DuneErosion, registry); + AddEntitiesForSectionResults(mechanism.SectionResults, registry); + AddEntitiesForDuneLocations(mechanism.DuneLocations, entity, registry); + AddEntitiesForFailureMechanismMeta(mechanism, entity, registry); + return entity; + } + + private static void AddEntitiesForSectionResults( + IEnumerable sectionResults, + PersistenceRegistry registry) + { + foreach (DuneErosionFailureMechanismSectionResult failureMechanismSectionResult in sectionResults) + { + DuneErosionSectionResultEntity sectionResultEntity = failureMechanismSectionResult.Create(); + FailureMechanismSectionEntity section = registry.Get(failureMechanismSectionResult.Section); + section.DuneErosionSectionResultEntities.Add(sectionResultEntity); + } + } + + private static void AddEntitiesForFailureMechanismMeta(DuneErosionFailureMechanism failureMechanism, + FailureMechanismEntity entity, + PersistenceRegistry registry) + { + var metaEntity = new DuneErosionFailureMechanismMetaEntity + { + N = failureMechanism.GeneralInput.N, + DuneLocationCalculationCollectionEntity4 = failureMechanism.CalculationsForMechanismSpecificFactorizedSignalingNorm.Create(registry), + DuneLocationCalculationCollectionEntity3 = failureMechanism.CalculationsForMechanismSpecificSignalingNorm.Create(registry), + DuneLocationCalculationCollectionEntity2 = failureMechanism.CalculationsForMechanismSpecificLowerLimitNorm.Create(registry), + DuneLocationCalculationCollectionEntity1 = failureMechanism.CalculationsForLowerLimitNorm.Create(registry), + DuneLocationCalculationCollectionEntity = failureMechanism.CalculationsForFactorizedLowerLimitNorm.Create(registry) + }; + + entity.DuneErosionFailureMechanismMetaEntities.Add(metaEntity); + } + + private static void AddEntitiesForDuneLocations(IEnumerable locations, FailureMechanismEntity entity, PersistenceRegistry registry) + { + var i = 0; + foreach (DuneLocation duneLocation in locations) + { + entity.DuneLocationEntities.Add(duneLocation.Create(registry, i++)); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/DuneErosion/DuneErosionFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/DuneErosion/DuneErosionFailureMechanismSectionResultCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/DuneErosion/DuneErosionFailureMechanismSectionResultCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.DuneErosion.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.DuneErosion +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class DuneErosionFailureMechanismSectionResultCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The result to create a database entity for. + /// A new . + /// Thrown when + /// is null. + internal static DuneErosionSectionResultEntity Create(this DuneErosionFailureMechanismSectionResult result) + { + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + return new DuneErosionSectionResultEntity + { + SimpleAssessmentResult = Convert.ToByte(result.SimpleAssessmentResult), + DetailedAssessmentResultForFactorizedSignalingNorm = Convert.ToByte(result.DetailedAssessmentResultForFactorizedSignalingNorm), + DetailedAssessmentResultForSignalingNorm = Convert.ToByte(result.DetailedAssessmentResultForSignalingNorm), + DetailedAssessmentResultForMechanismSpecificLowerLimitNorm = Convert.ToByte(result.DetailedAssessmentResultForMechanismSpecificLowerLimitNorm), + DetailedAssessmentResultForLowerLimitNorm = Convert.ToByte(result.DetailedAssessmentResultForLowerLimitNorm), + DetailedAssessmentResultForFactorizedLowerLimitNorm = Convert.ToByte(result.DetailedAssessmentResultForFactorizedLowerLimitNorm), + TailorMadeAssessmentResult = Convert.ToByte(result.TailorMadeAssessmentResult), + UseManualAssembly = Convert.ToByte(result.UseManualAssembly), + ManualAssemblyCategoryGroup = Convert.ToByte(result.ManualAssemblyCategoryGroup) + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/DuneErosion/DuneLocationCalculationCollectionCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/DuneErosion/DuneLocationCalculationCollectionCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/DuneErosion/DuneLocationCalculationCollectionCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,66 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Ringtoets.DuneErosion.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.DuneErosion +{ + /// + /// Extension methods for collections of related to creating a + /// . + /// + internal static class DuneLocationCalculationCollectionCreateExtensions + { + /// + /// Creates a based on the information + /// of the . + /// + /// The collection of + /// to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when any parameter is null. + internal static DuneLocationCalculationCollectionEntity Create(this IEnumerable calculations, + PersistenceRegistry registry) + { + if (calculations == null) + { + throw new ArgumentNullException(nameof(calculations)); + } + + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var collectionEntity = new DuneLocationCalculationCollectionEntity(); + foreach (DuneLocationCalculation calculation in calculations) + { + collectionEntity.DuneLocationCalculationEntities.Add(calculation.Create(registry)); + } + + return collectionEntity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/DuneErosion/DuneLocationCalculationCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/DuneErosion/DuneLocationCalculationCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/DuneErosion/DuneLocationCalculationCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,70 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.DuneErosion.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.DuneErosion +{ + /// + /// Extension methods for related to creating a . + /// + internal static class DuneLocationCalculationCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The calculation to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when any parameter is null. + internal static DuneLocationCalculationEntity Create(this DuneLocationCalculation calculation, PersistenceRegistry registry) + { + if (calculation == null) + { + throw new ArgumentNullException(nameof(calculation)); + } + + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var duneLocationCalculationEntity = new DuneLocationCalculationEntity + { + DuneLocationEntity = registry.Get(calculation.DuneLocation) + }; + CreateDuneLocationOutput(duneLocationCalculationEntity, calculation.Output); + + return duneLocationCalculationEntity; + } + + private static void CreateDuneLocationOutput(DuneLocationCalculationEntity calculationEntity, + DuneLocationCalculationOutput output) + { + if (output != null) + { + calculationEntity.DuneLocationCalculationOutputEntities.Add(output.Create()); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/DuneErosion/DuneLocationCalculationOutputCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/DuneErosion/DuneLocationCalculationOutputCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/DuneErosion/DuneLocationCalculationOutputCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,61 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.DuneErosion.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.DuneErosion +{ + /// + /// Extension methods for related to creating + /// a . + /// + internal static class DuneLocationCalculationOutputCreateExtensions + { + /// + /// Creates a based on the + /// information of the . + /// + /// The output to create a database entity for. + /// A new . + /// Thrown when is null. + internal static DuneLocationCalculationOutputEntity Create(this DuneLocationCalculationOutput output) + { + if (output == null) + { + throw new ArgumentNullException(nameof(output)); + } + + return new DuneLocationCalculationOutputEntity + { + WaterLevel = output.WaterLevel.ToNaNAsNull(), + WaveHeight = output.WaveHeight.ToNaNAsNull(), + WavePeriod = output.WavePeriod.ToNaNAsNull(), + TargetProbability = output.TargetProbability.ToNaNAsNull(), + TargetReliability = output.TargetReliability.ToNaNAsNull(), + CalculatedProbability = output.CalculatedProbability.ToNaNAsNull(), + CalculatedReliability = output.CalculatedReliability.ToNaNAsNull(), + CalculationConvergence = Convert.ToByte(output.CalculationConvergence) + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/DuneErosion/DuneLocationCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/DuneErosion/DuneLocationCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/DuneErosion/DuneLocationCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,76 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.DuneErosion.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.DuneErosion +{ + /// + /// Extension methods for related to creating a . + /// + internal static class DuneLocationCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The location to create a database entity for. + /// The object keeping track of create operations. + /// Index at which this instance resides inside its parent container. + /// A new . + /// Thrown when any parameter is null. + internal static DuneLocationEntity Create(this DuneLocation location, PersistenceRegistry registry, int order) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + if (registry.Contains(location)) + { + return registry.Get(location); + } + + var entity = new DuneLocationEntity + { + LocationId = location.Id, + Name = location.Name.DeepClone(), + LocationX = location.Location.X.ToNaNAsNull(), + LocationY = location.Location.Y.ToNaNAsNull(), + CoastalAreaId = location.CoastalAreaId, + Offset = location.Offset.ToNaNAsNull(), + Orientation = location.Orientation.ToNaNAsNull(), + D50 = location.D50.ToNaNAsNull(), + Order = order + }; + + registry.Register(entity, location); + return entity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/FailureMechanismCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/FailureMechanismCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/FailureMechanismCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,94 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create +{ + /// + /// Extension methods for related to creating a . + /// + internal static class FailureMechanismCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The failure mechanism to create a database entity for. + /// The type of the failure mechanism that is being created. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static FailureMechanismEntity Create(this IFailureMechanism mechanism, FailureMechanismType type, PersistenceRegistry registry) + { + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var entity = new FailureMechanismEntity + { + FailureMechanismType = (short) type, + IsRelevant = Convert.ToByte(mechanism.IsRelevant), + InputComments = mechanism.InputComments.Body.DeepClone(), + OutputComments = mechanism.OutputComments.Body.DeepClone(), + NotRelevantComments = mechanism.NotRelevantComments.Body.DeepClone(), + FailureMechanismSectionCollectionSourcePath = mechanism.FailureMechanismSectionSourcePath.DeepClone() + }; + + mechanism.AddEntitiesForFailureMechanismSections(registry, entity); + + return entity; + } + + /// + /// Creates instances based on the information of the . + /// + /// The failure mechanism to create a database failure mechanism section entities for. + /// The object keeping track of create operations. + /// The to which to add the created entities. + /// Thrown when either: + /// + /// is null + /// is null + /// + /// + internal static void AddEntitiesForFailureMechanismSections(this IFailureMechanism mechanism, PersistenceRegistry registry, FailureMechanismEntity entity) + { + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + foreach (FailureMechanismSection failureMechanismSection in mechanism.Sections) + { + entity.FailureMechanismSectionEntities.Add(failureMechanismSection.Create(registry)); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/FailureMechanismSectionCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/FailureMechanismSectionCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/FailureMechanismSectionCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,60 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Serializers; + +namespace Ringtoets.Storage.Core.Create +{ + /// + /// Extension methods for related to creating a . + /// + internal static class FailureMechanismSectionCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The section to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static FailureMechanismSectionEntity Create(this FailureMechanismSection section, PersistenceRegistry registry) + { + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var failureMechanismSectionEntity = new FailureMechanismSectionEntity + { + Name = section.Name.DeepClone(), + FailureMechanismSectionPointXml = new Point2DCollectionXmlSerializer().ToXml(section.Points) + }; + + registry.Register(failureMechanismSectionEntity, section); + + return failureMechanismSectionEntity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/ForeshoreProfileCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/ForeshoreProfileCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/ForeshoreProfileCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,78 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Serializers; + +namespace Ringtoets.Storage.Core.Create +{ + /// + /// Extension methods for related to creating a . + /// + public static class ForeshoreProfileCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The foreshore profile to create a database entity for. + /// The object keeping track of create operations. + /// The index at which resides within its parent. + /// A new . + /// Thrown when is null. + internal static ForeshoreProfileEntity Create(this ForeshoreProfile foreshoreProfile, PersistenceRegistry registry, int order) + { + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + if (registry.Contains(foreshoreProfile)) + { + return registry.Get(foreshoreProfile); + } + + var foreshoreProfileEntity = new ForeshoreProfileEntity + { + Id = foreshoreProfile.Id.DeepClone(), + Name = foreshoreProfile.Name.DeepClone(), + GeometryXml = new Point2DCollectionXmlSerializer().ToXml(foreshoreProfile.Geometry), + X = foreshoreProfile.WorldReferencePoint.X, + Y = foreshoreProfile.WorldReferencePoint.Y, + X0 = foreshoreProfile.X0, + Orientation = foreshoreProfile.Orientation, + Order = order + }; + + if (foreshoreProfile.HasBreakWater) + { + foreshoreProfileEntity.BreakWaterHeight = foreshoreProfile.BreakWater.Height; + foreshoreProfileEntity.BreakWaterType = Convert.ToByte(foreshoreProfile.BreakWater.Type); + } + + registry.Register(foreshoreProfileEntity, foreshoreProfile); + + return foreshoreProfileEntity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/DikeHeightOutputCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/DikeHeightOutputCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/DikeHeightOutputCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.Storage.Core.Create.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.GrassCoverErosionInwards +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class DikeHeightOutputCreateExtensions + { + /// + /// Creates a + /// based on the information of the . + /// + /// The output to create a database entity for. + /// A new . + /// Thrown when + /// is null. + internal static GrassCoverErosionInwardsDikeHeightOutputEntity Create(this DikeHeightOutput output) + { + if (output == null) + { + throw new ArgumentNullException(nameof(output)); + } + + return new GrassCoverErosionInwardsDikeHeightOutputEntity + { + DikeHeight = output.DikeHeight.ToNaNAsNull(), + TargetProbability = output.TargetProbability.ToNaNAsNull(), + TargetReliability = output.TargetReliability.ToNaNAsNull(), + CalculatedProbability = output.CalculatedProbability.ToNaNAsNull(), + CalculatedReliability = output.CalculatedReliability.ToNaNAsNull(), + CalculationConvergence = Convert.ToByte(output.CalculationConvergence), + GeneralResultFaultTreeIllustrationPointEntity = output.GeneralResult?.CreateGeneralResultFaultTreeIllustrationPointEntity() + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/DikeProfileCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/DikeProfileCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/DikeProfileCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,78 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Serializers; + +namespace Ringtoets.Storage.Core.Create.GrassCoverErosionInwards +{ + /// + /// Extension methods for related to creating a . + /// + internal static class DikeProfileCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The dike profile to create a database entity for. + /// The object keeping track of create operations. + /// Index at which this instance resides inside its parent container. + /// A new . + /// Thrown when is null. + internal static DikeProfileEntity Create(this DikeProfile dikeProfile, PersistenceRegistry registry, int order) + { + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + if (registry.Contains(dikeProfile)) + { + return registry.Get(dikeProfile); + } + + var sectionResultEntity = new DikeProfileEntity + { + X = dikeProfile.WorldReferencePoint.X, + Y = dikeProfile.WorldReferencePoint.Y, + X0 = dikeProfile.X0, + DikeGeometryXml = new RoughnessPointCollectionXmlSerializer().ToXml(dikeProfile.DikeGeometry), + ForeshoreXml = new Point2DCollectionXmlSerializer().ToXml(dikeProfile.ForeshoreGeometry), + Orientation = dikeProfile.Orientation, + DikeHeight = dikeProfile.DikeHeight, + Id = dikeProfile.Id.DeepClone(), + Name = dikeProfile.Name.DeepClone(), + Order = order + }; + if (dikeProfile.HasBreakWater) + { + sectionResultEntity.BreakWaterHeight = dikeProfile.BreakWater.Height; + sectionResultEntity.BreakWaterType = Convert.ToByte(dikeProfile.BreakWater.Type); + } + + registry.Register(sectionResultEntity, dikeProfile); + return sectionResultEntity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,101 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.GrassCoverErosionInwards +{ + /// + /// Extension methods for related + /// to creating a . + /// + internal static class GrassCoverErosionInwardsCalculationCreateExtensions + { + /// + /// Creates a based + /// on the information of the . + /// + /// The calculation to create a database entity for. + /// The object keeping track of create operations. + /// The index at where resides + /// in its parent container. + /// A new . + /// Thrown when is null. + internal static GrassCoverErosionInwardsCalculationEntity Create(this GrassCoverErosionInwardsCalculation calculation, PersistenceRegistry registry, int order) + { + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var entity = new GrassCoverErosionInwardsCalculationEntity + { + Name = calculation.Name.DeepClone(), + Comments = calculation.Comments.Body.DeepClone(), + Order = order + }; + SetInputValues(entity, calculation.InputParameters, registry); + SetOutputEntity(entity, calculation); + + registry.Register(entity, calculation); + + return entity; + } + + private static void SetOutputEntity(GrassCoverErosionInwardsCalculationEntity entity, GrassCoverErosionInwardsCalculation calculation) + { + if (calculation.HasOutput) + { + entity.GrassCoverErosionInwardsOutputEntities.Add(calculation.Output.Create()); + } + } + + private static void SetInputValues(GrassCoverErosionInwardsCalculationEntity entity, GrassCoverErosionInwardsInput input, PersistenceRegistry registry) + { + if (input.DikeProfile != null) + { + entity.DikeProfileEntity = registry.Get(input.DikeProfile); + } + + if (input.HydraulicBoundaryLocation != null) + { + entity.HydraulicLocationEntity = registry.Get(input.HydraulicBoundaryLocation); + } + + entity.BreakWaterHeight = input.BreakWater.Height.ToNaNAsNull(); + entity.BreakWaterType = Convert.ToByte(input.BreakWater.Type); + entity.UseBreakWater = Convert.ToByte(input.UseBreakWater); + entity.CriticalFlowRateMean = input.CriticalFlowRate.Mean.ToNaNAsNull(); + entity.CriticalFlowRateStandardDeviation = input.CriticalFlowRate.StandardDeviation.ToNaNAsNull(); + entity.Orientation = input.Orientation.ToNaNAsNull(); + entity.DikeHeightCalculationType = Convert.ToByte(input.DikeHeightCalculationType); + entity.OvertoppingRateCalculationType = Convert.ToByte(input.OvertoppingRateCalculationType); + entity.DikeHeight = input.DikeHeight.ToNaNAsNull(); + entity.UseForeshore = Convert.ToByte(input.UseForeshore); + entity.ShouldOvertoppingOutputIllustrationPointsBeCalculated = Convert.ToByte(input.ShouldOvertoppingOutputIllustrationPointsBeCalculated); + entity.ShouldDikeHeightIllustrationPointsBeCalculated = Convert.ToByte(input.ShouldDikeHeightIllustrationPointsBeCalculated); + entity.ShouldOvertoppingRateIllustrationPointsBeCalculated = Convert.ToByte(input.ShouldOvertoppingRateIllustrationPointsBeCalculated); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,85 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.GrassCoverErosionInwards +{ + /// + /// Extension methods for related to creating a . + /// + internal static class GrassCoverErosionInwardsFailureMechanismCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The failure mechanism to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static FailureMechanismEntity Create(this GrassCoverErosionInwardsFailureMechanism mechanism, PersistenceRegistry registry) + { + FailureMechanismEntity entity = mechanism.Create(FailureMechanismType.GrassRevetmentTopErosionAndInwards, registry); + AddEntitiesForGeneralInput(mechanism, entity); + AddEntitiesForDikeProfiles(mechanism, registry, entity); + entity.CalculationGroupEntity = mechanism.CalculationsGroup.Create(registry, 0); + AddEntitiesForSectionResults(mechanism.SectionResults, registry); + + return entity; + } + + private static void AddEntitiesForGeneralInput(GrassCoverErosionInwardsFailureMechanism mechanism, FailureMechanismEntity entity) + { + var metaEntity = new GrassCoverErosionInwardsFailureMechanismMetaEntity + { + N = mechanism.GeneralInput.N, + DikeProfileCollectionSourcePath = mechanism.DikeProfiles.SourcePath.DeepClone() + }; + entity.GrassCoverErosionInwardsFailureMechanismMetaEntities.Add(metaEntity); + } + + private static void AddEntitiesForDikeProfiles(GrassCoverErosionInwardsFailureMechanism mechanism, PersistenceRegistry registry, FailureMechanismEntity entity) + { + for (var i = 0; i < mechanism.DikeProfiles.Count; i++) + { + DikeProfile dikeProfile = mechanism.DikeProfiles[i]; + entity.DikeProfileEntities.Add(dikeProfile.Create(registry, i)); + } + } + + private static void AddEntitiesForSectionResults( + IEnumerable sectionResults, + PersistenceRegistry registry) + { + foreach (GrassCoverErosionInwardsFailureMechanismSectionResult failureMechanismSectionResult in sectionResults) + { + GrassCoverErosionInwardsSectionResultEntity sectionResultEntity = failureMechanismSectionResult.Create(registry); + FailureMechanismSectionEntity section = registry.Get(failureMechanismSectionResult.Section); + section.GrassCoverErosionInwardsSectionResultEntities.Add(sectionResultEntity); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismSectionResultCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismSectionResultCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,72 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.GrassCoverErosionInwards +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class GrassCoverErosionInwardsFailureMechanismSectionResultCreateExtensions + { + /// + /// Creates a + /// based on the information of the . + /// + /// The result to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when any parameter is null. + internal static GrassCoverErosionInwardsSectionResultEntity Create(this GrassCoverErosionInwardsFailureMechanismSectionResult result, + PersistenceRegistry registry) + { + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var sectionResultEntity = new GrassCoverErosionInwardsSectionResultEntity + { + SimpleAssessmentResult = Convert.ToByte(result.SimpleAssessmentResult), + DetailedAssessmentResult = Convert.ToByte(result.DetailedAssessmentResult), + TailorMadeAssessmentResult = Convert.ToByte(result.TailorMadeAssessmentResult), + TailorMadeAssessmentProbability = result.TailorMadeAssessmentProbability.ToNaNAsNull(), + UseManualAssembly = Convert.ToByte(result.UseManualAssembly), + ManualAssemblyProbability = result.ManualAssemblyProbability.ToNaNAsNull() + }; + if (result.Calculation != null) + { + sectionResultEntity.GrassCoverErosionInwardsCalculationEntity = registry.Get(result.Calculation); + } + + return sectionResultEntity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsOutputCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsOutputCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsOutputCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,77 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.Storage.Core.Create.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.GrassCoverErosionInwards +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class GrassCoverErosionInwardsOutputCreateExtensions + { + /// + /// Creates a based on + /// the information of the . + /// + /// The grass cover erosion inwards calculation output to create + /// a database entity for. + /// A new . + internal static GrassCoverErosionInwardsOutputEntity Create(this GrassCoverErosionInwardsOutput output) + { + OvertoppingOutput overtoppingOutput = output.OvertoppingOutput; + var entity = new GrassCoverErosionInwardsOutputEntity + { + IsOvertoppingDominant = Convert.ToByte(overtoppingOutput.IsOvertoppingDominant), + WaveHeight = overtoppingOutput.WaveHeight.ToNaNAsNull(), + Reliability = overtoppingOutput.Reliability.ToNaNAsNull(), + GeneralResultFaultTreeIllustrationPointEntity = overtoppingOutput.GeneralResult?.CreateGeneralResultFaultTreeIllustrationPointEntity() + }; + + AddEntityForDikeHeightOutput(entity, output.DikeHeightOutput); + AddEntityForOvertoppingRateOutput(entity, output.OvertoppingRateOutput); + + return entity; + } + + private static void AddEntityForDikeHeightOutput(GrassCoverErosionInwardsOutputEntity entity, + DikeHeightOutput output) + { + if (output != null) + { + entity.GrassCoverErosionInwardsDikeHeightOutputEntities.Add(output.Create()); + } + } + + private static void AddEntityForOvertoppingRateOutput(GrassCoverErosionInwardsOutputEntity entity, + OvertoppingRateOutput output) + { + if (output != null) + { + entity.GrassCoverErosionInwardsOvertoppingRateOutputEntities.Add(output.Create()); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/OvertoppingRateOutputCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/OvertoppingRateOutputCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionInwards/OvertoppingRateOutputCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.Storage.Core.Create.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.GrassCoverErosionInwards +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class OvertoppingRateOutputCreateExtensions + { + /// + /// Creates a + /// based on the information of the . + /// + /// The output to create a database entity for. + /// A new . + /// Thrown when + /// is null. + internal static GrassCoverErosionInwardsOvertoppingRateOutputEntity Create(this OvertoppingRateOutput output) + { + if (output == null) + { + throw new ArgumentNullException(nameof(output)); + } + + return new GrassCoverErosionInwardsOvertoppingRateOutputEntity + { + OvertoppingRate = output.OvertoppingRate.ToNaNAsNull(), + TargetProbability = output.TargetProbability.ToNaNAsNull(), + TargetReliability = output.TargetReliability.ToNaNAsNull(), + CalculatedProbability = output.CalculatedProbability.ToNaNAsNull(), + CalculatedReliability = output.CalculatedReliability.ToNaNAsNull(), + CalculationConvergence = Convert.ToByte(output.CalculationConvergence), + GeneralResultFaultTreeIllustrationPointEntity = output.GeneralResult?.CreateGeneralResultFaultTreeIllustrationPointEntity() + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,104 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.GrassCoverErosionOutwards.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.GrassCoverErosionOutwards +{ + /// + /// Extension methods for related to creating a . + /// + internal static class GrassCoverErosionOutwardsFailureMechanismCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The failure mechanism to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static FailureMechanismEntity Create(this GrassCoverErosionOutwardsFailureMechanism mechanism, PersistenceRegistry registry) + { + FailureMechanismEntity entity = mechanism.Create(FailureMechanismType.GrassRevetmentErosionOutwards, registry); + AddEntitiesForSectionResults(mechanism.SectionResults, registry); + AddEntitiesForFailureMechanismMeta(mechanism, entity, registry); + AddEntitiesForForeshoreProfiles(mechanism.ForeshoreProfiles, entity, registry); + entity.CalculationGroupEntity = mechanism.WaveConditionsCalculationGroup.Create(registry, 0); + + return entity; + } + + private static void AddEntitiesForFailureMechanismMeta(GrassCoverErosionOutwardsFailureMechanism failureMechanism, + FailureMechanismEntity entity, PersistenceRegistry registry) + { + var metaEntity = new GrassCoverErosionOutwardsFailureMechanismMetaEntity + { + ForeshoreProfileCollectionSourcePath = failureMechanism.ForeshoreProfiles.SourcePath.DeepClone(), + N = failureMechanism.GeneralInput.N, + HydraulicLocationCalculationCollectionEntity5 = failureMechanism.WaterLevelCalculationsForMechanismSpecificFactorizedSignalingNorm + .Create(registry), + HydraulicLocationCalculationCollectionEntity4 = failureMechanism.WaterLevelCalculationsForMechanismSpecificSignalingNorm + .Create(registry), + HydraulicLocationCalculationCollectionEntity3 = failureMechanism.WaterLevelCalculationsForMechanismSpecificLowerLimitNorm + .Create(registry), + HydraulicLocationCalculationCollectionEntity2 = failureMechanism.WaveHeightCalculationsForMechanismSpecificFactorizedSignalingNorm + .Create(registry), + HydraulicLocationCalculationCollectionEntity1 = failureMechanism.WaveHeightCalculationsForMechanismSpecificSignalingNorm + .Create(registry), + HydraulicLocationCalculationCollectionEntity = failureMechanism.WaveHeightCalculationsForMechanismSpecificLowerLimitNorm + .Create(registry) + }; + + entity.GrassCoverErosionOutwardsFailureMechanismMetaEntities.Add(metaEntity); + } + + private static void AddEntitiesForSectionResults( + IEnumerable sectionResults, + PersistenceRegistry registry) + { + foreach (GrassCoverErosionOutwardsFailureMechanismSectionResult failureMechanismSectionResult in sectionResults) + { + GrassCoverErosionOutwardsSectionResultEntity sectionResultEntity = failureMechanismSectionResult.Create(); + FailureMechanismSectionEntity section = registry.Get(failureMechanismSectionResult.Section); + section.GrassCoverErosionOutwardsSectionResultEntities.Add(sectionResultEntity); + } + } + + private static void AddEntitiesForForeshoreProfiles( + IEnumerable foreshoreProfiles, + FailureMechanismEntity entity, + PersistenceRegistry registry) + { + var i = 0; + + foreach (ForeshoreProfile foreshoreProfile in foreshoreProfiles) + { + ForeshoreProfileEntity foreshoreProfileEntity = foreshoreProfile.Create(registry, i++); + entity.ForeshoreProfileEntities.Add(foreshoreProfileEntity); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismSectionResultCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismSectionResultCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.GrassCoverErosionOutwards.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.GrassCoverErosionOutwards +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class GrassCoverErosionOutwardsFailureMechanismSectionResultCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The result to create a database entity for. + /// A new . + /// Thrown when is + /// null. + internal static GrassCoverErosionOutwardsSectionResultEntity Create(this GrassCoverErosionOutwardsFailureMechanismSectionResult result) + { + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + return new GrassCoverErosionOutwardsSectionResultEntity + { + SimpleAssessmentResult = Convert.ToByte(result.SimpleAssessmentResult), + DetailedAssessmentResultForFactorizedSignalingNorm = Convert.ToByte(result.DetailedAssessmentResultForFactorizedSignalingNorm), + DetailedAssessmentResultForSignalingNorm = Convert.ToByte(result.DetailedAssessmentResultForSignalingNorm), + DetailedAssessmentResultForMechanismSpecificLowerLimitNorm = Convert.ToByte(result.DetailedAssessmentResultForMechanismSpecificLowerLimitNorm), + DetailedAssessmentResultForLowerLimitNorm = Convert.ToByte(result.DetailedAssessmentResultForLowerLimitNorm), + DetailedAssessmentResultForFactorizedLowerLimitNorm = Convert.ToByte(result.DetailedAssessmentResultForFactorizedLowerLimitNorm), + TailorMadeAssessmentResult = Convert.ToByte(result.TailorMadeAssessmentResult), + UseManualAssembly = Convert.ToByte(result.UseManualAssembly), + ManualAssemblyCategoryGroup = Convert.ToByte(result.ManualAssemblyCategoryGroup) + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsCalculationCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsCalculationCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsCalculationCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,113 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.GrassCoverErosionOutwards.Data; +using Ringtoets.Revetment.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.GrassCoverErosionOutwards +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class GrassCoverErosionOutwardsWaveConditionsCalculationCreateExtensions + { + /// + /// Creates a based on the information of the + /// . + /// + /// The calculation to create a database entity for. + /// The object keeping track of create operations. + /// The index at which resides within its parent. + /// A new . + /// Thrown when any parameter is null. + internal static GrassCoverErosionOutwardsWaveConditionsCalculationEntity Create(this GrassCoverErosionOutwardsWaveConditionsCalculation calculation, + PersistenceRegistry registry, int order) + { + if (calculation == null) + { + throw new ArgumentNullException(nameof(calculation)); + } + + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var entity = new GrassCoverErosionOutwardsWaveConditionsCalculationEntity + { + Order = order, + Name = calculation.Name.DeepClone(), + Comments = calculation.Comments.Body.DeepClone() + }; + + SetInputParameters(entity, calculation.InputParameters, registry); + SetOutputEntities(entity, calculation); + + return entity; + } + + private static void SetInputParameters(GrassCoverErosionOutwardsWaveConditionsCalculationEntity entity, + FailureMechanismCategoryWaveConditionsInput calculationInput, + PersistenceRegistry registry) + { + HydraulicBoundaryLocation hydraulicBoundaryLocation = calculationInput.HydraulicBoundaryLocation; + if (hydraulicBoundaryLocation != null) + { + entity.HydraulicLocationEntity = registry.Get(hydraulicBoundaryLocation); + } + + if (calculationInput.ForeshoreProfile != null) + { + entity.ForeshoreProfileEntity = calculationInput.ForeshoreProfile.Create(registry, 0); + } + + entity.Orientation = calculationInput.Orientation.ToNaNAsNull(); + entity.UseBreakWater = Convert.ToByte(calculationInput.UseBreakWater); + entity.BreakWaterType = Convert.ToByte(calculationInput.BreakWater.Type); + entity.BreakWaterHeight = calculationInput.BreakWater.Height.ToNaNAsNull(); + entity.UseForeshore = Convert.ToByte(calculationInput.UseForeshore); + entity.UpperBoundaryRevetment = calculationInput.UpperBoundaryRevetment.ToNaNAsNull(); + entity.LowerBoundaryRevetment = calculationInput.LowerBoundaryRevetment.ToNaNAsNull(); + entity.UpperBoundaryWaterLevels = calculationInput.UpperBoundaryWaterLevels.ToNaNAsNull(); + entity.LowerBoundaryWaterLevels = calculationInput.LowerBoundaryWaterLevels.ToNaNAsNull(); + entity.StepSize = Convert.ToByte(calculationInput.StepSize); + entity.CategoryType = Convert.ToByte(calculationInput.CategoryType); + } + + private static void SetOutputEntities(GrassCoverErosionOutwardsWaveConditionsCalculationEntity entity, + GrassCoverErosionOutwardsWaveConditionsCalculation calculation) + { + if (calculation.HasOutput) + { + var i = 0; + foreach (WaveConditionsOutput output in calculation.Output.Items) + { + entity.GrassCoverErosionOutwardsWaveConditionsOutputEntities.Add(output.CreateGrassCoverErosionOutwardsWaveConditionsOutputEntity(i++)); + } + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverSlipOffInwards/GrassCoverSlipOffInwardsFailureMechanismCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverSlipOffInwards/GrassCoverSlipOffInwardsFailureMechanismCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverSlipOffInwards/GrassCoverSlipOffInwardsFailureMechanismCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Ringtoets.Integration.Data.StandAlone; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.GrassCoverSlipOffInwards +{ + /// + /// Extension methods for related to creating a . + /// + internal static class GrassCoverSlipOffInwardsFailureMechanismCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The failure mechanism to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static FailureMechanismEntity Create(this GrassCoverSlipOffInwardsFailureMechanism mechanism, PersistenceRegistry registry) + { + FailureMechanismEntity entity = mechanism.Create(FailureMechanismType.GrassRevetmentSlidingInwards, registry); + AddEntitiesForSectionResults(mechanism.SectionResults, registry); + + return entity; + } + + private static void AddEntitiesForSectionResults( + IEnumerable sectionResults, + PersistenceRegistry registry) + { + foreach (GrassCoverSlipOffInwardsFailureMechanismSectionResult failureMechanismSectionResult in sectionResults) + { + GrassCoverSlipOffInwardsSectionResultEntity sectionResultEntity = failureMechanismSectionResult.Create(); + FailureMechanismSectionEntity section = registry.Get(failureMechanismSectionResult.Section); + section.GrassCoverSlipOffInwardsSectionResultEntities.Add(sectionResultEntity); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverSlipOffInwards/GrassCoverSlipOffInwardsFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverSlipOffInwards/GrassCoverSlipOffInwardsFailureMechanismSectionResultCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverSlipOffInwards/GrassCoverSlipOffInwardsFailureMechanismSectionResultCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,60 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.GrassCoverSlipOffInwards +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class GrassCoverSlipOffInwardsFailureMechanismSectionResultCreateExtensions + { + /// + /// Creates a based on the information + /// of the . + /// + /// The result to create a database entity for. + /// A new . + /// Thrown when is null. + internal static GrassCoverSlipOffInwardsSectionResultEntity Create(this GrassCoverSlipOffInwardsFailureMechanismSectionResult result) + { + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + var sectionResultEntity = new GrassCoverSlipOffInwardsSectionResultEntity + { + SimpleAssessmentResult = Convert.ToByte(result.SimpleAssessmentResult), + DetailedAssessmentResult = Convert.ToByte(result.DetailedAssessmentResult), + TailorMadeAssessmentResult = Convert.ToByte(result.TailorMadeAssessmentResult), + UseManualAssembly = Convert.ToByte(result.UseManualAssembly), + ManualAssemblyCategoryGroup = Convert.ToByte(result.ManualAssemblyCategoryGroup) + }; + + return sectionResultEntity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverSlipOffOutwards/GrassCoverSlipOffOutwardsFailureMechanismCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverSlipOffOutwards/GrassCoverSlipOffOutwardsFailureMechanismCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverSlipOffOutwards/GrassCoverSlipOffOutwardsFailureMechanismCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Ringtoets.Integration.Data.StandAlone; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.GrassCoverSlipOffOutwards +{ + /// + /// Extension methods for related to creating a . + /// + internal static class GrassCoverSlipOffOutwardsFailureMechanismCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The failure mechanism to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static FailureMechanismEntity Create(this GrassCoverSlipOffOutwardsFailureMechanism mechanism, PersistenceRegistry registry) + { + FailureMechanismEntity entity = mechanism.Create(FailureMechanismType.GrassRevetmentSlidingOutwards, registry); + AddEntitiesForSectionResults(mechanism.SectionResults, registry); + + return entity; + } + + private static void AddEntitiesForSectionResults( + IEnumerable sectionResults, + PersistenceRegistry registry) + { + foreach (GrassCoverSlipOffOutwardsFailureMechanismSectionResult failureMechanismSectionResult in sectionResults) + { + GrassCoverSlipOffOutwardsSectionResultEntity sectionResultEntity = failureMechanismSectionResult.Create(); + FailureMechanismSectionEntity section = registry.Get(failureMechanismSectionResult.Section); + section.GrassCoverSlipOffOutwardsSectionResultEntities.Add(sectionResultEntity); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverSlipOffOutwards/GrassCoverSlipOffOutwardsFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverSlipOffOutwards/GrassCoverSlipOffOutwardsFailureMechanismSectionResultCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/GrassCoverSlipOffOutwards/GrassCoverSlipOffOutwardsFailureMechanismSectionResultCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,59 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.GrassCoverSlipOffOutwards +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class GrassCoverSlipOffOutwardsFailureMechanismSectionResultCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The result to create a database entity for. + /// A new . + /// Thrown when is null. + internal static GrassCoverSlipOffOutwardsSectionResultEntity Create(this GrassCoverSlipOffOutwardsFailureMechanismSectionResult result) + { + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + var sectionResultEntity = new GrassCoverSlipOffOutwardsSectionResultEntity + { + SimpleAssessmentResult = Convert.ToByte(result.SimpleAssessmentResult), + DetailedAssessmentResult = Convert.ToByte(result.DetailedAssessmentResult), + TailorMadeAssessmentResult = Convert.ToByte(result.TailorMadeAssessmentResult), + UseManualAssembly = Convert.ToByte(result.UseManualAssembly), + ManualAssemblyCategoryGroup = Convert.ToByte(result.ManualAssemblyCategoryGroup) + }; + + return sectionResultEntity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HeightStructures/HeightStructureCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HeightStructures/HeightStructureCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HeightStructures/HeightStructureCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,83 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.HeightStructures.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.HeightStructures +{ + /// + /// Extension methods for related to creating + /// a . + /// + internal static class HeightStructureCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The structure to create a database entity for. + /// The object keeping track of create operations. + /// The index at which resides within its parent. + /// A new . + /// Thrown when is null. + internal static HeightStructureEntity Create(this HeightStructure structure, PersistenceRegistry registry, int order) + { + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + if (registry.Contains(structure)) + { + return registry.Get(structure); + } + + var entity = new HeightStructureEntity + { + Name = structure.Name.DeepClone(), + Id = structure.Id.DeepClone(), + X = structure.Location.X.ToNaNAsNull(), + Y = structure.Location.Y.ToNaNAsNull(), + StructureNormalOrientation = structure.StructureNormalOrientation.ToNaNAsNull(), + AllowedLevelIncreaseStorageMean = structure.AllowedLevelIncreaseStorage.Mean.ToNaNAsNull(), + AllowedLevelIncreaseStorageStandardDeviation = structure.AllowedLevelIncreaseStorage.StandardDeviation.ToNaNAsNull(), + CriticalOvertoppingDischargeMean = structure.CriticalOvertoppingDischarge.Mean.ToNaNAsNull(), + CriticalOvertoppingDischargeCoefficientOfVariation = structure.CriticalOvertoppingDischarge.CoefficientOfVariation.ToNaNAsNull(), + FailureProbabilityStructureWithErosion = structure.FailureProbabilityStructureWithErosion.ToNaNAsNull(), + FlowWidthAtBottomProtectionMean = structure.FlowWidthAtBottomProtection.Mean.ToNaNAsNull(), + FlowWidthAtBottomProtectionStandardDeviation = structure.FlowWidthAtBottomProtection.StandardDeviation.ToNaNAsNull(), + LevelCrestStructureMean = structure.LevelCrestStructure.Mean.ToNaNAsNull(), + LevelCrestStructureStandardDeviation = structure.LevelCrestStructure.StandardDeviation.ToNaNAsNull(), + StorageStructureAreaMean = structure.StorageStructureArea.Mean.ToNaNAsNull(), + StorageStructureAreaCoefficientOfVariation = structure.StorageStructureArea.CoefficientOfVariation.ToNaNAsNull(), + WidthFlowAperturesMean = structure.WidthFlowApertures.Mean.ToNaNAsNull(), + WidthFlowAperturesStandardDeviation = structure.WidthFlowApertures.StandardDeviation.ToNaNAsNull(), + Order = order + }; + + registry.Register(entity, structure); + + return entity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HeightStructures/HeightStructuresFailureMechanismCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HeightStructures/HeightStructuresFailureMechanismCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HeightStructures/HeightStructuresFailureMechanismCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,102 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.HeightStructures.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.HeightStructures +{ + /// + /// Extension methods for related to creating a . + /// + internal static class HeightStructuresFailureMechanismCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The failure mechanism to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static FailureMechanismEntity Create(this HeightStructuresFailureMechanism mechanism, PersistenceRegistry registry) + { + FailureMechanismEntity entity = mechanism.Create(FailureMechanismType.StructureHeight, registry); + AddEntitiesForForeshoreProfiles(mechanism.ForeshoreProfiles, entity, registry); + AddEntitiesForHeightStructures(mechanism.HeightStructures, entity, registry); + AddEntitiesForFailureMechanismMeta(mechanism, entity); + entity.CalculationGroupEntity = mechanism.CalculationsGroup.Create(registry, 0); + AddEntitiesForSectionResults(mechanism.SectionResults, registry); + + return entity; + } + + private static void AddEntitiesForSectionResults( + IEnumerable sectionResults, + PersistenceRegistry registry) + { + foreach (HeightStructuresFailureMechanismSectionResult failureMechanismSectionResult in sectionResults) + { + HeightStructuresSectionResultEntity sectionResultEntity = failureMechanismSectionResult.Create(registry); + FailureMechanismSectionEntity section = registry.Get(failureMechanismSectionResult.Section); + section.HeightStructuresSectionResultEntities.Add(sectionResultEntity); + } + } + + private static void AddEntitiesForForeshoreProfiles( + ForeshoreProfileCollection foreshoreProfiles, + FailureMechanismEntity entity, + PersistenceRegistry registry) + { + for (var i = 0; i < foreshoreProfiles.Count; i++) + { + ForeshoreProfileEntity foreshoreProfileEntity = foreshoreProfiles[i].Create(registry, i); + entity.ForeshoreProfileEntities.Add(foreshoreProfileEntity); + } + } + + private static void AddEntitiesForHeightStructures( + StructureCollection structures, + FailureMechanismEntity entity, + PersistenceRegistry registry) + { + for (var i = 0; i < structures.Count; i++) + { + HeightStructureEntity structureEntity = structures[i].Create(registry, i); + entity.HeightStructureEntities.Add(structureEntity); + } + } + + private static void AddEntitiesForFailureMechanismMeta(HeightStructuresFailureMechanism mechanism, FailureMechanismEntity entity) + { + entity.HeightStructuresFailureMechanismMetaEntities.Add(new HeightStructuresFailureMechanismMetaEntity + { + N = mechanism.GeneralInput.N, + HeightStructureCollectionSourcePath = mechanism.HeightStructures.SourcePath.DeepClone(), + ForeshoreProfileCollectionSourcePath = mechanism.ForeshoreProfiles.SourcePath.DeepClone() + }); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HeightStructures/HeightStructuresFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HeightStructures/HeightStructuresFailureMechanismSectionResultCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HeightStructures/HeightStructuresFailureMechanismSectionResultCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,72 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.HeightStructures.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.HeightStructures +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class HeightStructuresFailureMechanismSectionResultCreateExtensions + { + /// + /// Creates a based on the information of the + /// . + /// + /// The result to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when any parameter is null. + internal static HeightStructuresSectionResultEntity Create(this HeightStructuresFailureMechanismSectionResult result, + PersistenceRegistry registry) + { + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var sectionResultEntity = new HeightStructuresSectionResultEntity + { + SimpleAssessmentResult = Convert.ToByte(result.SimpleAssessmentResult), + DetailedAssessmentResult = Convert.ToByte(result.DetailedAssessmentResult), + TailorMadeAssessmentResult = Convert.ToByte(result.TailorMadeAssessmentResult), + TailorMadeAssessmentProbability = result.TailorMadeAssessmentProbability.ToNaNAsNull(), + UseManualAssembly = Convert.ToByte(result.UseManualAssembly), + ManualAssemblyProbability = result.ManualAssemblyProbability.ToNaNAsNull() + }; + if (result.Calculation != null) + { + sectionResultEntity.HeightStructuresCalculationEntity = registry.Get(result.Calculation); + } + + return sectionResultEntity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HydraulicBoundaryLocationCalculationCollectionCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HydraulicBoundaryLocationCalculationCollectionCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HydraulicBoundaryLocationCalculationCollectionCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,67 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create +{ + /// + /// Extension methods for collections of related to creating a + /// . + /// + internal static class HydraulicBoundaryLocationCalculationCollectionCreateExtensions + { + /// + /// Creates a based on the information + /// of the . + /// + /// The collection of + /// to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when any parameter is null. + internal static HydraulicLocationCalculationCollectionEntity Create(this IEnumerable calculations, + PersistenceRegistry registry) + { + if (calculations == null) + { + throw new ArgumentNullException(nameof(calculations)); + } + + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var collectionEntity = new HydraulicLocationCalculationCollectionEntity(); + + foreach (HydraulicBoundaryLocationCalculation calculation in calculations) + { + collectionEntity.HydraulicLocationCalculationEntities.Add(calculation.Create(registry)); + } + + return collectionEntity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HydraulicBoundaryLocationCalculationCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HydraulicBoundaryLocationCalculationCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HydraulicBoundaryLocationCalculationCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,75 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create +{ + /// + /// Extension methods for related + /// to creating a . + /// + internal static class HydraulicBoundaryLocationCalculationCreateExtensions + { + /// + /// Creates a based on the information of + /// . + /// + /// The calculation to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when any parameter is null. + internal static HydraulicLocationCalculationEntity Create(this HydraulicBoundaryLocationCalculation calculation, + PersistenceRegistry registry) + { + if (calculation == null) + { + throw new ArgumentNullException(nameof(calculation)); + } + + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var hydraulicLocationCalculationEntity = new HydraulicLocationCalculationEntity + { + ShouldIllustrationPointsBeCalculated = Convert.ToByte(calculation.InputParameters.ShouldIllustrationPointsBeCalculated), + HydraulicLocationEntity = registry.Get(calculation.HydraulicBoundaryLocation) + }; + + CreateHydraulicBoundaryLocationCalculationOutput(hydraulicLocationCalculationEntity, calculation.Output); + + return hydraulicLocationCalculationEntity; + } + + private static void CreateHydraulicBoundaryLocationCalculationOutput(HydraulicLocationCalculationEntity hydraulicLocationCalculationEntity, + HydraulicBoundaryLocationCalculationOutput output) + { + if (output != null) + { + hydraulicLocationCalculationEntity.HydraulicLocationOutputEntities.Add(output.CreateHydraulicLocationOutputEntity()); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HydraulicBoundaryLocationCalculationOutputCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HydraulicBoundaryLocationCalculationOutputCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HydraulicBoundaryLocationCalculationOutputCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,60 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Storage.Core.Create.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create +{ + /// + /// Extension methods for related to creating a hydraulic boundary location output entity. + /// + internal static class HydraulicBoundaryLocationCalculationOutputCreateExtensions + { + /// + /// Creates a based + /// on the information of the . + /// + /// The output to create a database entity for. + /// A new . + /// Thrown when is null. + internal static HydraulicLocationOutputEntity CreateHydraulicLocationOutputEntity(this HydraulicBoundaryLocationCalculationOutput output) + { + if (output == null) + { + throw new ArgumentNullException(nameof(output)); + } + + return new HydraulicLocationOutputEntity + { + Result = output.Result.ToNaNAsNull(), + TargetProbability = output.TargetProbability.ToNaNAsNull(), + TargetReliability = output.TargetReliability.ToNaNAsNull(), + CalculatedProbability = output.CalculatedProbability.ToNaNAsNull(), + CalculatedReliability = output.CalculatedReliability.ToNaNAsNull(), + CalculationConvergence = Convert.ToByte(output.CalculationConvergence), + GeneralResultSubMechanismIllustrationPointEntity = output.GeneralResult?.CreateGeneralResultSubMechanismIllustrationPointEntity() + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HydraulicBoundaryLocationCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HydraulicBoundaryLocationCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HydraulicBoundaryLocationCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,73 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create +{ + /// + /// Extension methods for related to creating a . + /// + internal static class HydraulicBoundaryLocationCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The location to create a database entity for. + /// The object keeping track of create operations. + /// Index at which this instance resides inside its parent container. + /// A new . + /// Thrown when or + /// is null. + internal static HydraulicLocationEntity Create(this HydraulicBoundaryLocation location, PersistenceRegistry registry, int order) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + if (registry.Contains(location)) + { + return registry.Get(location); + } + + var entity = new HydraulicLocationEntity + { + LocationId = location.Id, + Name = location.Name.DeepClone(), + LocationX = location.Location.X.ToNaNAsNull(), + LocationY = location.Location.Y.ToNaNAsNull(), + Order = order + }; + + registry.Register(entity, location); + return entity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HydraulicLocationConfigurationSettingsCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HydraulicLocationConfigurationSettingsCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/HydraulicLocationConfigurationSettingsCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,69 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create +{ + /// + /// Extension methods for related + /// to creating a + /// + public static class HydraulicLocationConfigurationSettingsCreateExtensions + { + /// + /// Creates a based on the information of the + /// . + /// + /// The to create a + /// for. + /// A new . + /// Thrown when + /// is null. + internal static HydraulicBoundaryDatabaseEntity Create(this HydraulicBoundaryDatabase hydraulicBoundaryDatabase) + { + if (hydraulicBoundaryDatabase == null) + { + throw new ArgumentNullException(nameof(hydraulicBoundaryDatabase)); + } + + HydraulicLocationConfigurationSettings settings = hydraulicBoundaryDatabase.HydraulicLocationConfigurationSettings; + return new HydraulicBoundaryDatabaseEntity + { + FilePath = hydraulicBoundaryDatabase.FilePath.DeepClone(), + Version = hydraulicBoundaryDatabase.Version.DeepClone(), + HydraulicLocationConfigurationSettingsFilePath = settings.FilePath.DeepClone(), + HydraulicLocationConfigurationSettingsScenarioName = settings.ScenarioName.DeepClone(), + HydraulicLocationConfigurationSettingsYear = settings.Year, + HydraulicLocationConfigurationSettingsScope = settings.Scope.DeepClone(), + HydraulicLocationConfigurationSettingsSeaLevel = settings.SeaLevel.DeepClone(), + HydraulicLocationConfigurationSettingsRiverDischarge = settings.RiverDischarge.DeepClone(), + HydraulicLocationConfigurationSettingsLakeLevel = settings.LakeLevel.DeepClone(), + HydraulicLocationConfigurationSettingsWindDirection = settings.WindDirection.DeepClone(), + HydraulicLocationConfigurationSettingsWindSpeed = settings.WindSpeed.DeepClone(), + HydraulicLocationConfigurationSettingsComment = settings.Comment.DeepClone() + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/GeneralResultCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/GeneralResultCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/GeneralResultCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,133 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.IllustrationPoints +{ + /// + /// Extension methods for + /// related to creating an instance of . + /// + internal static class GeneralResultCreateExtensions + { + /// + /// Creates a based on + /// the information of . + /// + /// The general result sub mechanism to create a database + /// entity for. + /// A new . + /// Thrown when + /// is null. + public static GeneralResultSubMechanismIllustrationPointEntity CreateGeneralResultSubMechanismIllustrationPointEntity( + this GeneralResult generalResult) + { + if (generalResult == null) + { + throw new ArgumentNullException(nameof(generalResult)); + } + + var entity = new GeneralResultSubMechanismIllustrationPointEntity(); + + SetGoverningWindDirection(entity, generalResult.GoverningWindDirection); + + AddEntitiesForStochasts(entity, generalResult.Stochasts); + AddEntitiesForTopLevelSubMechanismIllustrationPoints( + entity, + generalResult.TopLevelIllustrationPoints); + + return entity; + } + + /// + /// Creates a based on the + /// information of . + /// + /// The general result to create a database entity for. + /// A new . + /// Thrown when + /// is null. + public static GeneralResultFaultTreeIllustrationPointEntity CreateGeneralResultFaultTreeIllustrationPointEntity( + this GeneralResult generalResult) + { + if (generalResult == null) + { + throw new ArgumentNullException(nameof(generalResult)); + } + + var entity = new GeneralResultFaultTreeIllustrationPointEntity(); + + SetGoverningWindDirection(entity, generalResult.GoverningWindDirection); + + AddEntitiesForStochasts(entity, generalResult.Stochasts); + AddEntitiesForTopLevelFaultTreeIllustrationPoints( + entity, generalResult.TopLevelIllustrationPoints); + + return entity; + } + + private static void SetGoverningWindDirection(IGeneralResultEntity generalResultEntity, + WindDirection windDirection) + { + generalResultEntity.GoverningWindDirectionAngle = windDirection.Angle; + generalResultEntity.GoverningWindDirectionName = windDirection.Name.DeepClone(); + } + + private static void AddEntitiesForStochasts(IGeneralResultEntity entity, + IEnumerable stochasts) + { + var order = 0; + foreach (Stochast stochast in stochasts) + { + entity.StochastEntities.Add(stochast.Create(order++)); + } + } + + private static void AddEntitiesForTopLevelSubMechanismIllustrationPoints( + GeneralResultSubMechanismIllustrationPointEntity entity, + IEnumerable illustrationPoints) + { + var order = 0; + foreach (TopLevelSubMechanismIllustrationPoint illustrationPoint in illustrationPoints) + { + entity.TopLevelSubMechanismIllustrationPointEntities.Add( + illustrationPoint.Create(order++)); + } + } + + private static void AddEntitiesForTopLevelFaultTreeIllustrationPoints( + GeneralResultFaultTreeIllustrationPointEntity entity, + IEnumerable illustrationPoints) + { + var order = 0; + foreach (TopLevelFaultTreeIllustrationPoint illustrationPoint in illustrationPoints) + { + entity.TopLevelFaultTreeIllustrationPointEntities.Add( + illustrationPoint.Create(order++)); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/IllustrationPointNodeCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/IllustrationPointNodeCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/IllustrationPointNodeCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,119 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.IllustrationPoints +{ + /// + /// Extension methods for + /// related to creating an instance of . + /// + internal static class IllustrationPointNodeCreateExtensions + { + /// + /// Creates a based on the information + /// of . + /// + /// The illustration point node to create a database + /// entity for. + /// The index at which + /// resides within its parent. + /// A new . + /// Thrown when + /// is null. + /// Thrown when + /// is not of type . + public static FaultTreeIllustrationPointEntity Create( + this IllustrationPointNode illustrationPointNode, + int order) + { + if (illustrationPointNode == null) + { + throw new ArgumentNullException(nameof(illustrationPointNode)); + } + + var faultTreeIllustrationPoint = illustrationPointNode.Data as FaultTreeIllustrationPoint; + if (faultTreeIllustrationPoint == null) + { + throw new NotSupportedException($"Illustration point type '{illustrationPointNode.Data.GetType()}' is not supported."); + } + + FaultTreeIllustrationPointEntity entity = CreateFaultTreeIllustrationPoint(faultTreeIllustrationPoint, + order); + + CreateChildElements(illustrationPointNode.Children, entity); + return entity; + } + + private static FaultTreeIllustrationPointEntity CreateFaultTreeIllustrationPoint( + FaultTreeIllustrationPoint illustrationPoint, + int order) + { + var entity = new FaultTreeIllustrationPointEntity + { + Beta = illustrationPoint.Beta, + CombinationType = Convert.ToByte(illustrationPoint.CombinationType), + Name = illustrationPoint.Name.DeepClone(), + Order = order + }; + AddEntitiesForStochasts(entity, illustrationPoint.Stochasts); + + return entity; + } + + private static void AddEntitiesForStochasts(FaultTreeIllustrationPointEntity entity, + IEnumerable stochasts) + { + var order = 0; + foreach (Stochast stochast in stochasts) + { + entity.StochastEntities.Add(stochast.Create(order++)); + } + } + + private static void CreateChildElements(IEnumerable illustrationPointNodes, + FaultTreeIllustrationPointEntity entity) + { + var i = 0; + foreach (IllustrationPointNode node in illustrationPointNodes) + { + var faultTreeIllustrationPoint = node.Data as FaultTreeIllustrationPoint; + if (faultTreeIllustrationPoint != null) + { + entity.FaultTreeIllustrationPointEntity1.Add(node.Create(i)); + } + + var subMechanismIllustrationPoint = node.Data as SubMechanismIllustrationPoint; + if (subMechanismIllustrationPoint != null) + { + entity.SubMechanismIllustrationPointEntities.Add(subMechanismIllustrationPoint.Create(i)); + } + + i++; + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/IllustrationPointResultCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/IllustrationPointResultCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/IllustrationPointResultCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,64 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.IllustrationPoints +{ + /// + /// Extension methods for related to creating an instance + /// of . + /// + internal static class IllustrationPointResultCreateExtensions + { + /// + /// Creates a based on the + /// information of the . + /// + /// The illustration point result to create a database + /// entity for. + /// The index at which + /// resides within its parent. + /// A new . + /// Thrown when + /// is null. + internal static IllustrationPointResultEntity Create( + this IllustrationPointResult illustrationPointResult, int order) + { + if (illustrationPointResult == null) + { + throw new ArgumentNullException(nameof(illustrationPointResult)); + } + + var entity = new IllustrationPointResultEntity + { + Description = illustrationPointResult.Description.DeepClone(), + Value = illustrationPointResult.Value, + Order = order + }; + + return entity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/StochastCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/StochastCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/StochastCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.IllustrationPoints +{ + /// + /// Extension methods for related to creating an instance of . + /// + internal static class StochastCreateExtensions + { + /// + /// Creates a based on the information + /// of the . + /// + /// The stochast to create a database entity for. + /// The index at which resides within its parent. + /// A new . + /// Thrown when + /// is null. + internal static StochastEntity Create( + this Stochast stochast, int order) + { + if (stochast == null) + { + throw new ArgumentNullException(nameof(stochast)); + } + + var entity = new StochastEntity + { + Name = stochast.Name.DeepClone(), + Alpha = stochast.Alpha, + Duration = stochast.Duration, + Order = order + }; + + return entity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/SubMechanismIllustrationPointCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/SubMechanismIllustrationPointCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/SubMechanismIllustrationPointCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,92 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.IllustrationPoints +{ + /// + /// Extension methods for + /// related to creating an instance of . + /// + internal static class SubMechanismIllustrationPointCreateExtensions + { + /// + /// Creates a based on + /// the information of . + /// + /// The sub mechanism illustration + /// point to create a database entity for. + /// The index at which + /// resides within its parent. + /// A new . + /// Thrown when + /// is null. + internal static SubMechanismIllustrationPointEntity Create( + this SubMechanismIllustrationPoint subMechanismIllustrationPoint, + int order) + { + if (subMechanismIllustrationPoint == null) + { + throw new ArgumentNullException(nameof(subMechanismIllustrationPoint)); + } + + var entity = new SubMechanismIllustrationPointEntity + { + Beta = subMechanismIllustrationPoint.Beta, + Name = subMechanismIllustrationPoint.Name.DeepClone(), + Order = order + }; + + AddEntitiesForSubMechanismIllustrationPointsStochasts(entity, subMechanismIllustrationPoint.Stochasts); + AddEntitiesForIllustrationPointResults(entity, subMechanismIllustrationPoint.IllustrationPointResults); + + return entity; + } + + private static void AddEntitiesForIllustrationPointResults(SubMechanismIllustrationPointEntity entity, + IEnumerable illustrationPointResults) + { + var order = 0; + foreach (IllustrationPointResult illustrationPointResult in illustrationPointResults) + { + entity.IllustrationPointResultEntities.Add( + illustrationPointResult.Create(order++)); + } + } + + private static void AddEntitiesForSubMechanismIllustrationPointsStochasts( + SubMechanismIllustrationPointEntity entity, + IEnumerable stochasts) + { + var order = 0; + foreach (SubMechanismIllustrationPointStochast subMechanismIllustrationPointStochast in stochasts) + { + entity.SubMechanismIllustrationPointStochastEntities.Add( + subMechanismIllustrationPointStochast.Create(order++)); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/SubMechanismIllustrationPointStochastCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/SubMechanismIllustrationPointStochastCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/SubMechanismIllustrationPointStochastCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,64 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.IllustrationPoints +{ + /// + /// Extension methods for related to creating an instance of + /// . + /// + internal static class SubMechanismIllustrationPointStochastCreateExtensions + { + /// + /// Creates a based on the information + /// of the . + /// + /// The stochast to create a database entity for. + /// The index at which resides within its parent. + /// A new . + /// Thrown when + /// is null. + internal static SubMechanismIllustrationPointStochastEntity Create( + this SubMechanismIllustrationPointStochast subMechanismIllustrationPointStochast, int order) + { + if (subMechanismIllustrationPointStochast == null) + { + throw new ArgumentNullException(nameof(subMechanismIllustrationPointStochast)); + } + + var entity = new SubMechanismIllustrationPointStochastEntity + { + Name = subMechanismIllustrationPointStochast.Name.DeepClone(), + Alpha = subMechanismIllustrationPointStochast.Alpha, + Duration = subMechanismIllustrationPointStochast.Duration, + Realization = subMechanismIllustrationPointStochast.Realization, + Order = order + }; + + return entity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/TopLevelFaultTreeIllustrationPointCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/TopLevelFaultTreeIllustrationPointCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/TopLevelFaultTreeIllustrationPointCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,67 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.IllustrationPoints +{ + /// + /// Extension methods for + /// related to creating an instance of . + /// + internal static class TopLevelFaultTreeIllustrationPointCreateExtensions + { + /// + /// Creates a + /// based on the information of . + /// + /// The top level illustration point to + /// create a database entity for. + /// The index at which + /// resides within its parent. + /// A . + /// Thrown when + /// is null. + public static TopLevelFaultTreeIllustrationPointEntity Create( + this TopLevelFaultTreeIllustrationPoint topLevelFaultTreeIllustrationPoint, + int order) + { + if (topLevelFaultTreeIllustrationPoint == null) + { + throw new ArgumentNullException(nameof(topLevelFaultTreeIllustrationPoint)); + } + + WindDirection windDirection = topLevelFaultTreeIllustrationPoint.WindDirection; + return new TopLevelFaultTreeIllustrationPointEntity + { + ClosingSituation = topLevelFaultTreeIllustrationPoint.ClosingSituation.DeepClone(), + WindDirectionName = windDirection.Name.DeepClone(), + WindDirectionAngle = windDirection.Angle, + FaultTreeIllustrationPointEntity = + topLevelFaultTreeIllustrationPoint.FaultTreeNodeRoot.Create(0), + Order = order + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/TopLevelSubMechanismIllustrationPointCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/TopLevelSubMechanismIllustrationPointCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/IllustrationPoints/TopLevelSubMechanismIllustrationPointCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,68 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.IllustrationPoints +{ + /// + /// Extension methods for + /// related to creating an instance of . + /// + internal static class TopLevelSubMechanismIllustrationPointCreateExtensions + { + /// + /// Creates a + /// based on the information of . + /// + /// The top level illustration point + /// to create a database entity for. + /// The index at which + /// resides within its parent. + /// A . + /// Thrown when + /// is null. + internal static TopLevelSubMechanismIllustrationPointEntity Create( + this TopLevelSubMechanismIllustrationPoint topLevelSubMechanismIllustrationPoint, + int order) + { + if (topLevelSubMechanismIllustrationPoint == null) + { + throw new ArgumentNullException(nameof(topLevelSubMechanismIllustrationPoint)); + } + + WindDirection windDirection = topLevelSubMechanismIllustrationPoint.WindDirection; + return new TopLevelSubMechanismIllustrationPointEntity + { + ClosingSituation = topLevelSubMechanismIllustrationPoint.ClosingSituation.DeepClone(), + WindDirectionName = windDirection.Name.DeepClone(), + WindDirectionAngle = windDirection.Angle, + SubMechanismIllustrationPointEntity = + topLevelSubMechanismIllustrationPoint.SubMechanismIllustrationPoint + .Create(0), + Order = order + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsCalculationScenarioCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsCalculationScenarioCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsCalculationScenarioCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,191 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.MacroStabilityInwards.Primitives; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.MacroStabilityInwards +{ + /// + /// Extension methods for related to creating + /// a . + /// + internal static class MacroStabilityInwardsCalculationScenarioCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The macro stability inwards calculation to create a database entity for. + /// The object keeping track of create operations. + /// The index at which resides within its parent. + /// A new . + /// Thrown when is null. + public static MacroStabilityInwardsCalculationEntity Create(this MacroStabilityInwardsCalculationScenario calculation, + PersistenceRegistry registry, + int order) + { + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var entity = new MacroStabilityInwardsCalculationEntity + { + Name = calculation.Name.DeepClone(), + Comment = calculation.Comments.Body.DeepClone(), + ScenarioContribution = calculation.Contribution.ToNaNAsNull(), + RelevantForScenario = Convert.ToByte(calculation.IsRelevant), + Order = order + }; + SetInputParametersToEntity(entity, calculation.InputParameters, registry); + AddEntityForMacroStabilityInwardsOutput(entity, calculation.Output); + + return entity; + } + + private static void SetInputParametersToEntity(MacroStabilityInwardsCalculationEntity entity, + MacroStabilityInwardsInput inputParameters, + PersistenceRegistry registry) + { + if (inputParameters.SurfaceLine != null) + { + entity.SurfaceLineEntity = registry.Get(inputParameters.SurfaceLine); + } + + if (inputParameters.StochasticSoilProfile != null) + { + entity.MacroStabilityInwardsStochasticSoilProfileEntity = registry.Get(inputParameters.StochasticSoilProfile); + } + + SetHydraulicBoundaryLocationInputToEntity(entity, inputParameters, registry); + + entity.SlipPlaneMinimumDepth = inputParameters.SlipPlaneMinimumDepth.ToNaNAsNull(); + entity.SlipPlaneMinimumLength = inputParameters.SlipPlaneMinimumLength.ToNaNAsNull(); + entity.MaximumSliceWidth = inputParameters.MaximumSliceWidth.ToNaNAsNull(); + + entity.MoveGrid = Convert.ToByte(inputParameters.MoveGrid); + entity.DikeSoilScenario = Convert.ToByte(inputParameters.DikeSoilScenario); + + entity.WaterLevelRiverAverage = inputParameters.WaterLevelRiverAverage.ToNaNAsNull(); + + entity.DrainageConstructionPresent = Convert.ToByte(inputParameters.DrainageConstructionPresent); + entity.DrainageConstructionCoordinateX = inputParameters.XCoordinateDrainageConstruction.ToNaNAsNull(); + entity.DrainageConstructionCoordinateZ = inputParameters.ZCoordinateDrainageConstruction.ToNaNAsNull(); + + entity.MinimumLevelPhreaticLineAtDikeTopRiver = inputParameters.MinimumLevelPhreaticLineAtDikeTopRiver.ToNaNAsNull(); + entity.MinimumLevelPhreaticLineAtDikeTopPolder = inputParameters.MinimumLevelPhreaticLineAtDikeTopPolder.ToNaNAsNull(); + + SetLocationInputExtremeParametersToEntity(entity, inputParameters.LocationInputExtreme); + SetLocationInputDailyParametersToEntity(entity, inputParameters.LocationInputDaily); + + entity.AdjustPhreaticLine3And4ForUplift = Convert.ToByte(inputParameters.AdjustPhreaticLine3And4ForUplift); + entity.LeakageLengthOutwardsPhreaticLine4 = inputParameters.LeakageLengthOutwardsPhreaticLine4.ToNaNAsNull(); + entity.LeakageLengthInwardsPhreaticLine4 = inputParameters.LeakageLengthInwardsPhreaticLine4.ToNaNAsNull(); + entity.LeakageLengthOutwardsPhreaticLine3 = inputParameters.LeakageLengthOutwardsPhreaticLine3.ToNaNAsNull(); + entity.LeakageLengthInwardsPhreaticLine3 = inputParameters.LeakageLengthInwardsPhreaticLine3.ToNaNAsNull(); + entity.PiezometricHeadPhreaticLine2Outwards = inputParameters.PiezometricHeadPhreaticLine2Outwards.ToNaNAsNull(); + entity.PiezometricHeadPhreaticLine2Inwards = inputParameters.PiezometricHeadPhreaticLine2Inwards.ToNaNAsNull(); + + entity.GridDeterminationType = Convert.ToByte(inputParameters.GridDeterminationType); + entity.TangentLineDeterminationType = Convert.ToByte(inputParameters.TangentLineDeterminationType); + + entity.TangentLineZTop = inputParameters.TangentLineZTop.ToNaNAsNull(); + entity.TangentLineZBottom = inputParameters.TangentLineZBottom.ToNaNAsNull(); + entity.TangentLineNumber = inputParameters.TangentLineNumber; + + SetGridParametersToEntity(entity, inputParameters.LeftGrid, inputParameters.RightGrid); + + entity.CreateZones = Convert.ToByte(inputParameters.CreateZones); + entity.ZoningBoundariesDeterminationType = Convert.ToByte(inputParameters.ZoningBoundariesDeterminationType); + entity.ZoneBoundaryLeft = inputParameters.ZoneBoundaryLeft.ToNaNAsNull(); + entity.ZoneBoundaryRight = inputParameters.ZoneBoundaryRight.ToNaNAsNull(); + } + + private static void SetGridParametersToEntity(MacroStabilityInwardsCalculationEntity entity, + MacroStabilityInwardsGrid leftGrid, + MacroStabilityInwardsGrid rightGrid) + { + entity.LeftGridXLeft = leftGrid.XLeft.ToNaNAsNull(); + entity.LeftGridXRight = leftGrid.XRight.ToNaNAsNull(); + entity.LeftGridNrOfHorizontalPoints = leftGrid.NumberOfHorizontalPoints; + entity.LeftGridZTop = leftGrid.ZTop.ToNaNAsNull(); + entity.LeftGridZBottom = leftGrid.ZBottom.ToNaNAsNull(); + entity.LeftGridNrOfVerticalPoints = leftGrid.NumberOfVerticalPoints; + + entity.RightGridXLeft = rightGrid.XLeft.ToNaNAsNull(); + entity.RightGridXRight = rightGrid.XRight.ToNaNAsNull(); + entity.RightGridNrOfHorizontalPoints = rightGrid.NumberOfHorizontalPoints; + entity.RightGridZTop = rightGrid.ZTop.ToNaNAsNull(); + entity.RightGridZBottom = rightGrid.ZBottom.ToNaNAsNull(); + entity.RightGridNrOfVerticalPoints = rightGrid.NumberOfVerticalPoints; + } + + private static void SetLocationInputDailyParametersToEntity(MacroStabilityInwardsCalculationEntity entity, + IMacroStabilityInwardsLocationInputDaily inputParameters) + { + entity.LocationInputDailyWaterLevelPolder = inputParameters.WaterLevelPolder.ToNaNAsNull(); + entity.LocationInputDailyUseDefaultOffsets = Convert.ToByte(inputParameters.UseDefaultOffsets); + + entity.LocationInputDailyPhreaticLineOffsetBelowDikeTopAtRiver = inputParameters.PhreaticLineOffsetBelowDikeTopAtRiver.ToNaNAsNull(); + entity.LocationInputDailyPhreaticLineOffsetBelowDikeTopAtPolder = inputParameters.PhreaticLineOffsetBelowDikeTopAtPolder.ToNaNAsNull(); + entity.LocationInputDailyPhreaticLineOffsetBelowShoulderBaseInside = inputParameters.PhreaticLineOffsetBelowShoulderBaseInside.ToNaNAsNull(); + entity.LocationInputDailyPhreaticLineOffsetDikeToeAtPolder = inputParameters.PhreaticLineOffsetBelowDikeToeAtPolder.ToNaNAsNull(); + } + + private static void SetLocationInputExtremeParametersToEntity(MacroStabilityInwardsCalculationEntity entity, + IMacroStabilityInwardsLocationInputExtreme inputParameters) + { + entity.LocationInputExtremeWaterLevelPolder = inputParameters.WaterLevelPolder.ToNaNAsNull(); + entity.LocationInputExtremeUseDefaultOffsets = Convert.ToByte(inputParameters.UseDefaultOffsets); + + entity.LocationInputExtremePhreaticLineOffsetBelowDikeTopAtRiver = inputParameters.PhreaticLineOffsetBelowDikeTopAtRiver.ToNaNAsNull(); + entity.LocationInputExtremePhreaticLineOffsetBelowDikeTopAtPolder = inputParameters.PhreaticLineOffsetBelowDikeTopAtPolder.ToNaNAsNull(); + entity.LocationInputExtremePhreaticLineOffsetBelowShoulderBaseInside = inputParameters.PhreaticLineOffsetBelowShoulderBaseInside.ToNaNAsNull(); + entity.LocationInputExtremePhreaticLineOffsetDikeToeAtPolder = inputParameters.PhreaticLineOffsetBelowDikeToeAtPolder.ToNaNAsNull(); + entity.LocationInputExtremePenetrationLength = inputParameters.PenetrationLength.ToNaNAsNull(); + } + + private static void SetHydraulicBoundaryLocationInputToEntity(MacroStabilityInwardsCalculationEntity entity, + MacroStabilityInwardsInput inputParameters, + PersistenceRegistry registry) + { + entity.UseAssessmentLevelManualInput = Convert.ToByte(inputParameters.UseAssessmentLevelManualInput); + entity.AssessmentLevel = inputParameters.AssessmentLevel.ToNaNAsNull(); + + if (inputParameters.HydraulicBoundaryLocation != null) + { + entity.HydraulicLocationEntity = registry.Get(inputParameters.HydraulicBoundaryLocation); + } + } + + private static void AddEntityForMacroStabilityInwardsOutput(MacroStabilityInwardsCalculationEntity entity, + MacroStabilityInwardsOutput output) + { + if (output != null) + { + entity.MacroStabilityInwardsCalculationOutputEntities.Add(output.Create()); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsFailureMechanismCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsFailureMechanismCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsFailureMechanismCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,106 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Util.Extensions; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.MacroStabilityInwards.Data.SoilProfile; +using Ringtoets.MacroStabilityInwards.Primitives; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.MacroStabilityInwards +{ + /// + /// Extension methods for related to creating a . + /// + internal static class MacroStabilityInwardsFailureMechanismCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The failure mechanism to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + public static FailureMechanismEntity Create(this MacroStabilityInwardsFailureMechanism mechanism, + PersistenceRegistry registry) + { + FailureMechanismEntity entity = mechanism.Create(FailureMechanismType.MacroStabilityInwards, registry); + + AddEntitiesForFailureMechanismMeta(mechanism, entity); + AddEntitiesForStochasticSoilModels(mechanism, registry, entity); + AddEntitiesForSurfaceLines(mechanism, registry, entity); + AddEntitiesForSectionResults(mechanism.SectionResults, registry); + + entity.CalculationGroupEntity = mechanism.CalculationsGroup.Create(registry, 0); + + return entity; + } + + private static void AddEntitiesForFailureMechanismMeta(MacroStabilityInwardsFailureMechanism mechanism, + FailureMechanismEntity entity) + { + var metaEntity = new MacroStabilityInwardsFailureMechanismMetaEntity + { + A = mechanism.MacroStabilityInwardsProbabilityAssessmentInput.A, + StochasticSoilModelCollectionSourcePath = mechanism.StochasticSoilModels.SourcePath.DeepClone(), + SurfaceLineCollectionSourcePath = mechanism.SurfaceLines.SourcePath.DeepClone() + }; + + entity.MacroStabilityInwardsFailureMechanismMetaEntities.Add(metaEntity); + } + + private static void AddEntitiesForStochasticSoilModels(MacroStabilityInwardsFailureMechanism mechanism, + PersistenceRegistry registry, + FailureMechanismEntity entity) + { + var index = 0; + foreach (MacroStabilityInwardsStochasticSoilModel stochasticSoilModel in mechanism.StochasticSoilModels) + { + entity.StochasticSoilModelEntities.Add(stochasticSoilModel.Create(registry, index++)); + } + } + + private static void AddEntitiesForSurfaceLines(MacroStabilityInwardsFailureMechanism mechanism, + PersistenceRegistry registry, + FailureMechanismEntity entity) + { + var index = 0; + foreach (MacroStabilityInwardsSurfaceLine surfaceLine in mechanism.SurfaceLines) + { + entity.SurfaceLineEntities.Add(surfaceLine.Create(registry, index++)); + } + } + + private static void AddEntitiesForSectionResults( + IEnumerable sectionResults, + PersistenceRegistry registry) + { + foreach (MacroStabilityInwardsFailureMechanismSectionResult failureMechanismSectionResult in sectionResults) + { + MacroStabilityInwardsSectionResultEntity sectionResultEntity = failureMechanismSectionResult.Create(); + FailureMechanismSectionEntity section = registry.Get(failureMechanismSectionResult.Section); + section.MacroStabilityInwardsSectionResultEntities.Add(sectionResultEntity); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsFailureMechanismSectionResultCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsFailureMechanismSectionResultCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,61 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.MacroStabilityInwards +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class MacroStabilityInwardsFailureMechanismSectionResultCreateExtensions + { + /// + /// Creates a based on the information + /// of the . + /// + /// The result to create a database entity for. + /// A new . + /// Thrown when is null. + internal static MacroStabilityInwardsSectionResultEntity Create(this MacroStabilityInwardsFailureMechanismSectionResult result) + { + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + var sectionResultEntity = new MacroStabilityInwardsSectionResultEntity + { + SimpleAssessmentResult = Convert.ToByte(result.SimpleAssessmentResult), + DetailedAssessmentResult = Convert.ToByte(result.DetailedAssessmentResult), + TailorMadeAssessmentResult = Convert.ToByte(result.TailorMadeAssessmentResult), + TailorMadeAssessmentProbability = result.TailorMadeAssessmentProbability.ToNaNAsNull(), + UseManualAssembly = Convert.ToByte(result.UseManualAssembly), + ManualAssemblyProbability = result.ManualAssemblyProbability.ToNaNAsNull() + }; + + return sectionResultEntity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsOutputCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsOutputCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsOutputCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,114 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Serializers; + +namespace Ringtoets.Storage.Core.Create.MacroStabilityInwards +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class MacroStabilityInwardsOutputCreateExtensions + { + /// + /// Creates a based on the information + /// of the . + /// + /// The calculation output for macro stability inwards failure mechanism to + /// create a database entity for. + /// A new . + /// Thrown when + /// is null. + public static MacroStabilityInwardsCalculationOutputEntity Create(this MacroStabilityInwardsOutput output) + { + if (output == null) + { + throw new ArgumentNullException(nameof(output)); + } + + var entity = new MacroStabilityInwardsCalculationOutputEntity + { + FactorOfStability = output.FactorOfStability.ToNaNAsNull(), + ForbiddenZonesXEntryMin = output.ForbiddenZonesXEntryMin.ToNaNAsNull(), + ForbiddenZonesXEntryMax = output.ForbiddenZonesXEntryMax.ToNaNAsNull(), + ZValue = output.ZValue.ToNaNAsNull() + }; + SetSlidingCurveParametersToEntity(entity, output.SlidingCurve); + SetSlipPlaneParametersToEntity(entity, output.SlipPlane); + + return entity; + } + + private static void SetSlidingCurveParametersToEntity(MacroStabilityInwardsCalculationOutputEntity entity, + MacroStabilityInwardsSlidingCurve slidingCurve) + { + entity.SlidingCurveSliceXML = new MacroStabilityInwardsSliceCollectionXmlSerializer().ToXml(slidingCurve.Slices); + entity.SlidingCurveNonIteratedHorizontalForce = slidingCurve.NonIteratedHorizontalForce.ToNaNAsNull(); + entity.SlidingCurveIteratedHorizontalForce = slidingCurve.IteratedHorizontalForce.ToNaNAsNull(); + + MacroStabilityInwardsSlidingCircle leftCircle = slidingCurve.LeftCircle; + entity.SlidingCurveLeftSlidingCircleCenterX = leftCircle.Center.X.ToNaNAsNull(); + entity.SlidingCurveLeftSlidingCircleCenterY = leftCircle.Center.Y.ToNaNAsNull(); + entity.SlidingCurveLeftSlidingCircleRadius = leftCircle.Radius.ToNaNAsNull(); + entity.SlidingCurveLeftSlidingCircleIsActive = Convert.ToByte(leftCircle.IsActive); + entity.SlidingCurveLeftSlidingCircleNonIteratedForce = leftCircle.NonIteratedForce.ToNaNAsNull(); + entity.SlidingCurveLeftSlidingCircleIteratedForce = leftCircle.IteratedForce.ToNaNAsNull(); + entity.SlidingCurveLeftSlidingCircleDrivingMoment = leftCircle.DrivingMoment.ToNaNAsNull(); + entity.SlidingCurveLeftSlidingCircleResistingMoment = leftCircle.ResistingMoment.ToNaNAsNull(); + + MacroStabilityInwardsSlidingCircle rightCircle = slidingCurve.RightCircle; + entity.SlidingCurveRightSlidingCircleCenterX = rightCircle.Center.X.ToNaNAsNull(); + entity.SlidingCurveRightSlidingCircleCenterY = rightCircle.Center.Y.ToNaNAsNull(); + entity.SlidingCurveRightSlidingCircleRadius = rightCircle.Radius.ToNaNAsNull(); + entity.SlidingCurveRightSlidingCircleIsActive = Convert.ToByte(rightCircle.IsActive); + entity.SlidingCurveRightSlidingCircleNonIteratedForce = rightCircle.NonIteratedForce.ToNaNAsNull(); + entity.SlidingCurveRightSlidingCircleIteratedForce = rightCircle.IteratedForce.ToNaNAsNull(); + entity.SlidingCurveRightSlidingCircleDrivingMoment = rightCircle.DrivingMoment.ToNaNAsNull(); + entity.SlidingCurveRightSlidingCircleResistingMoment = rightCircle.ResistingMoment.ToNaNAsNull(); + } + + private static void SetSlipPlaneParametersToEntity(MacroStabilityInwardsCalculationOutputEntity entity, + MacroStabilityInwardsSlipPlaneUpliftVan slipPlane) + { + entity.SlipPlaneTangentLinesXml = new TangentLineCollectionXmlSerializer().ToXml(slipPlane.TangentLines); + + MacroStabilityInwardsGrid leftGrid = slipPlane.LeftGrid; + entity.SlipPlaneLeftGridXLeft = leftGrid.XLeft.ToNaNAsNull(); + entity.SlipPlaneLeftGridXRight = leftGrid.XRight.ToNaNAsNull(); + entity.SlipPlaneLeftGridNrOfHorizontalPoints = leftGrid.NumberOfHorizontalPoints; + entity.SlipPlaneLeftGridZTop = leftGrid.ZTop.ToNaNAsNull(); + entity.SlipPlaneLeftGridZBottom = leftGrid.ZBottom.ToNaNAsNull(); + entity.SlipPlaneLeftGridNrOfVerticalPoints = leftGrid.NumberOfVerticalPoints; + + MacroStabilityInwardsGrid rightGrid = slipPlane.RightGrid; + entity.SlipPlaneRightGridXLeft = rightGrid.XLeft.ToNaNAsNull(); + entity.SlipPlaneRightGridXRight = rightGrid.XRight.ToNaNAsNull(); + entity.SlipPlaneRightGridNrOfHorizontalPoints = rightGrid.NumberOfHorizontalPoints; + entity.SlipPlaneRightGridZTop = rightGrid.ZTop.ToNaNAsNull(); + entity.SlipPlaneRightGridZBottom = rightGrid.ZBottom.ToNaNAsNull(); + entity.SlipPlaneRightGridNrOfVerticalPoints = rightGrid.NumberOfVerticalPoints; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsPreconsolidationStressCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsPreconsolidationStressCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsPreconsolidationStressCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,60 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.MacroStabilityInwards.Data.SoilProfile; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.MacroStabilityInwards +{ + /// + /// Extension methods for related to creating + /// a . + /// + internal static class MacroStabilityInwardsPreconsolidationStressCreateExtensions + { + /// + /// Creates a based on the information + /// of the . + /// + /// PreconsolidationStress to create a database entity for. + /// Index at which this instance resides inside its parent container. + /// A new . + /// Thrown when is null. + public static MacroStabilityInwardsPreconsolidationStressEntity Create(this MacroStabilityInwardsPreconsolidationStress preconsolidationStress, + int order) + { + if (preconsolidationStress == null) + { + throw new ArgumentNullException(nameof(preconsolidationStress)); + } + + return new MacroStabilityInwardsPreconsolidationStressEntity + { + CoordinateX = preconsolidationStress.Location.X, + CoordinateZ = preconsolidationStress.Location.Y, + PreconsolidationStressMean = preconsolidationStress.Stress.Mean.ToNaNAsNull(), + PreconsolidationStressCoefficientOfVariation = preconsolidationStress.Stress.CoefficientOfVariation.ToNaNAsNull(), + Order = order + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer1DCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer1DCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer1DCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,81 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.MacroStabilityInwards.Data.SoilProfile; +using Ringtoets.MacroStabilityInwards.Primitives; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.MacroStabilityInwards +{ + /// + /// Extension methods for related to creating + /// a . + /// + internal static class MacroStabilityInwardsSoilLayer1DCreateExtensions + { + /// + /// Creates a based on the information + /// of the . + /// + /// The soil layer to create a database entity for. + /// Index at which this instance resides inside its parent container. + /// A new . + /// Thrown when is null. + public static MacroStabilityInwardsSoilLayerOneDEntity Create(this MacroStabilityInwardsSoilLayer1D soilLayer, + int order) + { + if (soilLayer == null) + { + throw new ArgumentNullException(nameof(soilLayer)); + } + + MacroStabilityInwardsSoilLayerData data = soilLayer.Data; + return new MacroStabilityInwardsSoilLayerOneDEntity + { + Top = soilLayer.Top.ToNaNAsNull(), + IsAquifer = Convert.ToByte(data.IsAquifer), + MaterialName = data.MaterialName.DeepClone(), + Color = data.Color.ToInt64(), + UsePop = Convert.ToByte(data.UsePop), + ShearStrengthModel = Convert.ToByte(data.ShearStrengthModel), + AbovePhreaticLevelMean = data.AbovePhreaticLevel.Mean.ToNaNAsNull(), + AbovePhreaticLevelCoefficientOfVariation = data.AbovePhreaticLevel.CoefficientOfVariation.ToNaNAsNull(), + AbovePhreaticLevelShift = data.AbovePhreaticLevel.Shift.ToNaNAsNull(), + BelowPhreaticLevelMean = data.BelowPhreaticLevel.Mean.ToNaNAsNull(), + BelowPhreaticLevelCoefficientOfVariation = data.BelowPhreaticLevel.CoefficientOfVariation.ToNaNAsNull(), + BelowPhreaticLevelShift = data.BelowPhreaticLevel.Shift.ToNaNAsNull(), + CohesionMean = data.Cohesion.Mean.ToNaNAsNull(), + CohesionCoefficientOfVariation = data.Cohesion.CoefficientOfVariation.ToNaNAsNull(), + FrictionAngleMean = data.FrictionAngle.Mean.ToNaNAsNull(), + FrictionAngleCoefficientOfVariation = data.FrictionAngle.CoefficientOfVariation.ToNaNAsNull(), + ShearStrengthRatioMean = data.ShearStrengthRatio.Mean.ToNaNAsNull(), + ShearStrengthRatioCoefficientOfVariation = data.ShearStrengthRatio.CoefficientOfVariation.ToNaNAsNull(), + StrengthIncreaseExponentMean = data.StrengthIncreaseExponent.Mean.ToNaNAsNull(), + StrengthIncreaseExponentCoefficientOfVariation = data.StrengthIncreaseExponent.CoefficientOfVariation.ToNaNAsNull(), + PopMean = data.Pop.Mean.ToNaNAsNull(), + PopCoefficientOfVariation = data.Pop.CoefficientOfVariation.ToNaNAsNull(), + Order = order + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer2DCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer2DCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSoilLayer2DCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,95 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Linq; +using Core.Common.Util.Extensions; +using Ringtoets.MacroStabilityInwards.Primitives; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Serializers; + +namespace Ringtoets.Storage.Core.Create.MacroStabilityInwards +{ + /// + /// Extension methods for related to creating + /// a . + /// + internal static class MacroStabilityInwardsSoilLayer2DCreateExtensions + { + /// + /// Creates a based on the information + /// of the . + /// + /// The soil layer to create a database entity for. + /// Index at which this instance resides inside its parent container. + /// A new . + /// Thrown when is null. + public static MacroStabilityInwardsSoilLayerTwoDEntity Create(this MacroStabilityInwardsSoilLayer2D soilLayer, + int order) + { + if (soilLayer == null) + { + throw new ArgumentNullException(nameof(soilLayer)); + } + + MacroStabilityInwardsSoilLayerData data = soilLayer.Data; + var entity = new MacroStabilityInwardsSoilLayerTwoDEntity + { + OuterRingXml = new Point2DCollectionXmlSerializer().ToXml(soilLayer.OuterRing.Points), + IsAquifer = Convert.ToByte(data.IsAquifer), + MaterialName = data.MaterialName.DeepClone(), + Color = data.Color.ToInt64(), + UsePop = Convert.ToByte(data.UsePop), + ShearStrengthModel = Convert.ToByte(data.ShearStrengthModel), + AbovePhreaticLevelMean = data.AbovePhreaticLevel.Mean.ToNaNAsNull(), + AbovePhreaticLevelCoefficientOfVariation = data.AbovePhreaticLevel.CoefficientOfVariation.ToNaNAsNull(), + AbovePhreaticLevelShift = data.AbovePhreaticLevel.Shift.ToNaNAsNull(), + BelowPhreaticLevelMean = data.BelowPhreaticLevel.Mean.ToNaNAsNull(), + BelowPhreaticLevelCoefficientOfVariation = data.BelowPhreaticLevel.CoefficientOfVariation.ToNaNAsNull(), + BelowPhreaticLevelShift = data.BelowPhreaticLevel.Shift.ToNaNAsNull(), + CohesionMean = data.Cohesion.Mean.ToNaNAsNull(), + CohesionCoefficientOfVariation = data.Cohesion.CoefficientOfVariation.ToNaNAsNull(), + FrictionAngleMean = data.FrictionAngle.Mean.ToNaNAsNull(), + FrictionAngleCoefficientOfVariation = data.FrictionAngle.CoefficientOfVariation.ToNaNAsNull(), + ShearStrengthRatioMean = data.ShearStrengthRatio.Mean.ToNaNAsNull(), + ShearStrengthRatioCoefficientOfVariation = data.ShearStrengthRatio.CoefficientOfVariation.ToNaNAsNull(), + StrengthIncreaseExponentMean = data.StrengthIncreaseExponent.Mean.ToNaNAsNull(), + StrengthIncreaseExponentCoefficientOfVariation = data.StrengthIncreaseExponent.CoefficientOfVariation.ToNaNAsNull(), + PopMean = data.Pop.Mean.ToNaNAsNull(), + PopCoefficientOfVariation = data.Pop.CoefficientOfVariation.ToNaNAsNull(), + Order = order + }; + + AddNestedLayers(entity, soilLayer); + + return entity; + } + + private static void AddNestedLayers(MacroStabilityInwardsSoilLayerTwoDEntity entity, + MacroStabilityInwardsSoilLayer2D soilLayer) + { + for (var i = 0; i < soilLayer.NestedLayers.Count(); i++) + { + entity.MacroStabilityInwardsSoilLayerTwoDEntity1.Add(soilLayer.NestedLayers.ElementAt(i).Create(i)); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSoilProfile1DCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSoilProfile1DCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSoilProfile1DCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,85 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Util.Extensions; +using Ringtoets.MacroStabilityInwards.Data.SoilProfile; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.MacroStabilityInwards +{ + /// + /// Extension methods for related to creating + /// a . + /// + internal static class MacroStabilityInwardsSoilProfile1DCreateExtensions + { + /// + /// Creates a based on the information + /// of the . + /// + /// The soil profile to create a database entity for. + /// The object keeping track of create operations. + /// A new or one from the + /// if it was created for the earlier. + /// Thrown when any input parameter is null. + public static MacroStabilityInwardsSoilProfileOneDEntity Create(this MacroStabilityInwardsSoilProfile1D soilProfile, + PersistenceRegistry registry) + { + if (soilProfile == null) + { + throw new ArgumentNullException(nameof(soilProfile)); + } + + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + if (registry.Contains(soilProfile)) + { + return registry.Get(soilProfile); + } + + var entity = new MacroStabilityInwardsSoilProfileOneDEntity + { + Name = soilProfile.Name.DeepClone(), + Bottom = soilProfile.Bottom.ToNaNAsNull() + }; + + AddEntitiesForSoilLayers(soilProfile.Layers, entity); + + registry.Register(entity, soilProfile); + return entity; + } + + private static void AddEntitiesForSoilLayers(IEnumerable layers, + MacroStabilityInwardsSoilProfileOneDEntity entity) + { + var index = 0; + foreach (MacroStabilityInwardsSoilLayer1D layer in layers) + { + entity.MacroStabilityInwardsSoilLayerOneDEntities.Add(layer.Create(index++)); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSoilProfile2DCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSoilProfile2DCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSoilProfile2DCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,96 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Util.Extensions; +using Ringtoets.MacroStabilityInwards.Data.SoilProfile; +using Ringtoets.MacroStabilityInwards.Primitives; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.MacroStabilityInwards +{ + /// + /// Extension methods for related to creating + /// a . + /// + internal static class MacroStabilityInwardsSoilProfile2DCreateExtensions + { + /// + /// Creates a based on the information + /// of the . + /// + /// The soil profile to create a database entity for. + /// The object keeping track of create operations. + /// A new or one from the + /// if it was created for the earlier. + /// Thrown when any input parameter is null. + public static MacroStabilityInwardsSoilProfileTwoDEntity Create(this MacroStabilityInwardsSoilProfile2D soilProfile, + PersistenceRegistry registry) + { + if (soilProfile == null) + { + throw new ArgumentNullException(nameof(soilProfile)); + } + + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + if (registry.Contains(soilProfile)) + { + return registry.Get(soilProfile); + } + + var entity = new MacroStabilityInwardsSoilProfileTwoDEntity + { + Name = soilProfile.Name.DeepClone() + }; + + AddEntitiesForSoilLayers(soilProfile.Layers, entity); + AddEntitiesForPreconsolidationStresses(soilProfile.PreconsolidationStresses, entity); + + registry.Register(entity, soilProfile); + return entity; + } + + private static void AddEntitiesForSoilLayers(IEnumerable layers, + MacroStabilityInwardsSoilProfileTwoDEntity entity) + { + var index = 0; + foreach (MacroStabilityInwardsSoilLayer2D layer in layers) + { + entity.MacroStabilityInwardsSoilLayerTwoDEntities.Add(layer.Create(index++)); + } + } + + private static void AddEntitiesForPreconsolidationStresses(IEnumerable preconsolidationStresses, + MacroStabilityInwardsSoilProfileTwoDEntity entity) + { + var index = 0; + foreach (MacroStabilityInwardsPreconsolidationStress preconsolidationStress in preconsolidationStresses) + { + entity.MacroStabilityInwardsPreconsolidationStressEntities.Add(preconsolidationStress.Create(index++)); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilModelCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilModelCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilModelCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,83 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.MacroStabilityInwards.Data.SoilProfile; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Serializers; + +namespace Ringtoets.Storage.Core.Create.MacroStabilityInwards +{ + /// + /// Extension methods for related to creating + /// a . + /// + internal static class MacroStabilityInwardsStochasticSoilModelCreateExtensions + { + /// + /// Creates a based on the information of the + /// . + /// + /// The model to create a database entity for. + /// The object keeping track of create operations. + /// Index at which this instance resides inside its parent container. + /// A new . + /// Thrown when any input parameter is null. + public static StochasticSoilModelEntity Create(this MacroStabilityInwardsStochasticSoilModel model, + PersistenceRegistry registry, + int order) + { + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + if (registry.Contains(model)) + { + return registry.Get(model); + } + + var entity = new StochasticSoilModelEntity + { + Name = model.Name.DeepClone(), + StochasticSoilModelSegmentPointXml = new Point2DCollectionXmlSerializer().ToXml(model.Geometry), + Order = order + }; + + AddEntitiesForStochasticSoilProfiles(model, registry, entity); + + registry.Register(entity, model); + return entity; + } + + private static void AddEntitiesForStochasticSoilProfiles(MacroStabilityInwardsStochasticSoilModel model, + PersistenceRegistry registry, + StochasticSoilModelEntity entity) + { + var i = 0; + foreach (MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile in model.StochasticSoilProfiles) + { + entity.MacroStabilityInwardsStochasticSoilProfileEntities.Add(stochasticSoilProfile.Create(registry, i++)); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,108 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.MacroStabilityInwards.Data.SoilProfile; +using Ringtoets.MacroStabilityInwards.Primitives; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.MacroStabilityInwards +{ + /// + /// Extension methods for related to + /// creating a . + /// + internal static class MacroStabilityInwardsStochasticSoilProfileCreateExtensions + { + /// + /// Creates a based on + /// the information of the . + /// + /// The stochastic soil profile to create a database entity for. + /// The object keeping track of create operations. + /// Index at which this instance resides inside its parent container. + /// A new . + /// Thrown when any input parameter is null. + /// Thrown when is + /// not of type or . + public static MacroStabilityInwardsStochasticSoilProfileEntity Create(this MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile, + PersistenceRegistry registry, + int order) + { + if (stochasticSoilProfile == null) + { + throw new ArgumentNullException(nameof(stochasticSoilProfile)); + } + + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + if (registry.Contains(stochasticSoilProfile)) + { + return registry.Get(stochasticSoilProfile); + } + + var entity = new MacroStabilityInwardsStochasticSoilProfileEntity + { + Probability = stochasticSoilProfile.Probability, + Order = order + }; + + AddEntityForProfile(stochasticSoilProfile.SoilProfile, entity, registry); + + registry.Register(entity, stochasticSoilProfile); + return entity; + } + + /// + /// Adds the entity representation of to the . + /// + /// The soil profile to store. + /// The entity to update. + /// The registry to use for persisting entities. + /// Thrown when is + /// not of type or . + private static void AddEntityForProfile(IMacroStabilityInwardsSoilProfile soilProfile, + MacroStabilityInwardsStochasticSoilProfileEntity entity, + PersistenceRegistry registry) + { + var soilProfile1D = soilProfile as MacroStabilityInwardsSoilProfile1D; + if (soilProfile1D != null) + { + entity.MacroStabilityInwardsSoilProfileOneDEntity = soilProfile1D.Create(registry); + return; + } + + var soilProfile2D = soilProfile as MacroStabilityInwardsSoilProfile2D; + if (soilProfile2D != null) + { + entity.MacroStabilityInwardsSoilProfileTwoDEntity = soilProfile2D.Create(registry); + return; + } + + string exceptionMessage = $"{soilProfile.GetType().Name} is not supported. " + + $"Supported types are: {nameof(MacroStabilityInwardsSoilProfile1D)} and {nameof(MacroStabilityInwardsSoilProfile2D)}."; + throw new NotSupportedException(exceptionMessage); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSurfaceLineCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSurfaceLineCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSurfaceLineCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,117 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Linq; +using Core.Common.Base.Geometry; +using Core.Common.Util.Extensions; +using Ringtoets.MacroStabilityInwards.Primitives; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Serializers; + +namespace Ringtoets.Storage.Core.Create.MacroStabilityInwards +{ + /// + /// Extensions methods for related to creating + /// a . + /// + internal static class MacroStabilityInwardsSurfaceLineCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The surface line to create a database entity for. + /// The object keeping track of create operations. + /// Index at which this instance resides inside its parent container. + /// A new . + /// Thrown when any input parameter is null. + internal static SurfaceLineEntity Create(this MacroStabilityInwardsSurfaceLine surfaceLine, + PersistenceRegistry registry, + int order) + { + if (surfaceLine == null) + { + throw new ArgumentNullException(nameof(surfaceLine)); + } + + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + if (registry.Contains(surfaceLine)) + { + return registry.Get(surfaceLine); + } + + var entity = new SurfaceLineEntity + { + Name = surfaceLine.Name.DeepClone(), + ReferenceLineIntersectionX = surfaceLine.ReferenceLineIntersectionWorldPoint?.X.ToNaNAsNull(), + ReferenceLineIntersectionY = surfaceLine.ReferenceLineIntersectionWorldPoint?.Y.ToNaNAsNull(), + PointsXml = new Point3DCollectionXmlSerializer().ToXml(surfaceLine.Points), + Order = order + }; + CreateCharacteristicPointEntities(surfaceLine, entity); + + registry.Register(entity, surfaceLine); + + return entity; + } + + private static void CreateCharacteristicPointEntities(MacroStabilityInwardsSurfaceLine surfaceLine, SurfaceLineEntity entity) + { + Tuple[] characteristicPointAssociations = + { + Tuple.Create(surfaceLine.SurfaceLevelOutside, MacroStabilityInwardsCharacteristicPointType.SurfaceLevelOutside), + Tuple.Create(surfaceLine.DikeTopAtPolder, MacroStabilityInwardsCharacteristicPointType.DikeTopAtPolder), + Tuple.Create(surfaceLine.DikeTopAtRiver, MacroStabilityInwardsCharacteristicPointType.DikeTopAtRiver), + Tuple.Create(surfaceLine.ShoulderBaseInside, MacroStabilityInwardsCharacteristicPointType.ShoulderBaseInside), + Tuple.Create(surfaceLine.ShoulderTopInside, MacroStabilityInwardsCharacteristicPointType.ShoulderTopInside), + Tuple.Create(surfaceLine.BottomDitchDikeSide, MacroStabilityInwardsCharacteristicPointType.BottomDitchDikeSide), + Tuple.Create(surfaceLine.BottomDitchPolderSide, MacroStabilityInwardsCharacteristicPointType.BottomDitchPolderSide), + Tuple.Create(surfaceLine.DikeToeAtPolder, MacroStabilityInwardsCharacteristicPointType.DikeToeAtPolder), + Tuple.Create(surfaceLine.DikeToeAtRiver, MacroStabilityInwardsCharacteristicPointType.DikeToeAtRiver), + Tuple.Create(surfaceLine.DitchDikeSide, MacroStabilityInwardsCharacteristicPointType.DitchDikeSide), + Tuple.Create(surfaceLine.DitchPolderSide, MacroStabilityInwardsCharacteristicPointType.DitchPolderSide), + Tuple.Create(surfaceLine.SurfaceLevelInside, MacroStabilityInwardsCharacteristicPointType.SurfaceLevelInside) + }; + foreach (Tuple characteristicPointToSave in characteristicPointAssociations.Where(t => t.Item1 != null)) + { + MacroStabilityInwardsCharacteristicPointEntity characteristicPointEntity = CreateCharacteristicPointEntity(characteristicPointToSave.Item1, + characteristicPointToSave.Item2); + entity.MacroStabilityInwardsCharacteristicPointEntities.Add(characteristicPointEntity); + } + } + + private static MacroStabilityInwardsCharacteristicPointEntity CreateCharacteristicPointEntity(Point3D point, MacroStabilityInwardsCharacteristicPointType type) + { + var entity = new MacroStabilityInwardsCharacteristicPointEntity + { + Type = Convert.ToByte(type), + X = point.X.ToNaNAsNull(), + Y = point.Y.ToNaNAsNull(), + Z = point.Z.ToNaNAsNull() + }; + return entity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacrostabilityOutwards/MacroStabilityOutwardsFailureMechanismCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacrostabilityOutwards/MacroStabilityOutwardsFailureMechanismCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacrostabilityOutwards/MacroStabilityOutwardsFailureMechanismCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,74 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Ringtoets.Integration.Data.StandAlone; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.MacroStabilityOutwards +{ + /// + /// Extension methods for related to creating a . + /// + internal static class MacroStabilityOutwardsFailureMechanismCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The failure mechanism to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static FailureMechanismEntity Create(this MacroStabilityOutwardsFailureMechanism mechanism, PersistenceRegistry registry) + { + FailureMechanismEntity entity = mechanism.Create(FailureMechanismType.MacroStabilityOutwards, registry); + AddEntitiesForSectionResults(mechanism.SectionResults, registry); + AddEntitiesForFailureMechanismMeta(mechanism, entity); + + return entity; + } + + private static void AddEntitiesForSectionResults( + IEnumerable sectionResults, + PersistenceRegistry registry) + { + foreach (MacroStabilityOutwardsFailureMechanismSectionResult macroStabilityOutwardsFailureMechanismSectionResult in sectionResults) + { + MacroStabilityOutwardsSectionResultEntity sectionResultEntity = macroStabilityOutwardsFailureMechanismSectionResult.Create(); + FailureMechanismSectionEntity section = registry.Get(macroStabilityOutwardsFailureMechanismSectionResult.Section); + section.MacroStabilityOutwardsSectionResultEntities.Add(sectionResultEntity); + } + } + + private static void AddEntitiesForFailureMechanismMeta(MacroStabilityOutwardsFailureMechanism mechanism, + FailureMechanismEntity entity) + { + var metaEntity = new MacroStabilityOutwardsFailureMechanismMetaEntity + { + A = mechanism.MacroStabilityOutwardsProbabilityAssessmentInput.A + }; + + entity.MacroStabilityOutwardsFailureMechanismMetaEntities.Add(metaEntity); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacrostabilityOutwards/MacroStabilityOutwardsFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacrostabilityOutwards/MacroStabilityOutwardsFailureMechanismSectionResultCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/MacrostabilityOutwards/MacroStabilityOutwardsFailureMechanismSectionResultCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,61 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.MacroStabilityOutwards +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class MacroStabilityOutwardsFailureMechanismSectionResultCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The result to create a database entity for. + /// A new . + /// Thrown when is null. + internal static MacroStabilityOutwardsSectionResultEntity Create(this MacroStabilityOutwardsFailureMechanismSectionResult result) + { + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + var sectionResultEntity = new MacroStabilityOutwardsSectionResultEntity + { + SimpleAssessmentResult = Convert.ToByte(result.SimpleAssessmentResult), + DetailedAssessmentResult = Convert.ToByte(result.DetailedAssessmentResult), + DetailedAssessmentProbability = result.DetailedAssessmentProbability.ToNaNAsNull(), + TailorMadeAssessmentResult = Convert.ToByte(result.TailorMadeAssessmentResult), + TailorMadeAssessmentProbability = result.TailorMadeAssessmentProbability.ToNaNAsNull(), + UseManualAssembly = Convert.ToByte(result.UseManualAssembly), + ManualAssemblyCategoryGroup = Convert.ToByte(result.ManualAssemblyCategoryGroup) + }; + + return sectionResultEntity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Microstability/MicrostabilityFailureMechanismCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Microstability/MicrostabilityFailureMechanismCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Microstability/MicrostabilityFailureMechanismCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Ringtoets.Integration.Data.StandAlone; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.Microstability +{ + /// + /// Extension methods for related to creating a . + /// + internal static class MicrostabilityFailureMechanismCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The failure mechanism to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static FailureMechanismEntity Create(this MicrostabilityFailureMechanism mechanism, PersistenceRegistry registry) + { + FailureMechanismEntity entity = mechanism.Create(FailureMechanismType.Microstability, registry); + AddEntitiesForSectionResults(mechanism.SectionResults, registry); + + return entity; + } + + private static void AddEntitiesForSectionResults( + IEnumerable sectionResults, + PersistenceRegistry registry) + { + foreach (MicrostabilityFailureMechanismSectionResult failureMechanismSectionResult in sectionResults) + { + MicrostabilitySectionResultEntity sectionResultEntity = failureMechanismSectionResult.Create(); + FailureMechanismSectionEntity section = registry.Get(failureMechanismSectionResult.Section); + section.MicrostabilitySectionResultEntities.Add(sectionResultEntity); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Microstability/MicrostabilityFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Microstability/MicrostabilityFailureMechanismSectionResultCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Microstability/MicrostabilityFailureMechanismSectionResultCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,59 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.Microstability +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class MicrostabilityFailureMechanismSectionResultCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The result to create a database entity for. + /// A new . + /// Thrown when is null. + internal static MicrostabilitySectionResultEntity Create(this MicrostabilityFailureMechanismSectionResult result) + { + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + var sectionResultEntity = new MicrostabilitySectionResultEntity + { + SimpleAssessmentResult = Convert.ToByte(result.SimpleAssessmentResult), + DetailedAssessmentResult = Convert.ToByte(result.DetailedAssessmentResult), + TailorMadeAssessmentResult = Convert.ToByte(result.TailorMadeAssessmentResult), + UseManualAssembly = Convert.ToByte(result.UseManualAssembly), + ManualAssemblyCategoryGroup = Convert.ToByte(result.ManualAssemblyCategoryGroup) + }; + + return sectionResultEntity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/PersistenceRegistry.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/PersistenceRegistry.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/PersistenceRegistry.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,1011 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using Core.Common.Util; +using Ringtoets.ClosingStructures.Data; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Data.Structures; +using Ringtoets.DuneErosion.Data; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.HeightStructures.Data; +using Ringtoets.MacroStabilityInwards.Data.SoilProfile; +using Ringtoets.MacroStabilityInwards.Primitives; +using Ringtoets.Piping.Data.SoilProfile; +using Ringtoets.Piping.Primitives; +using Ringtoets.StabilityPointStructures.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create +{ + /// + /// This class can be used to keep track of create and update operations on a database. + /// This information can be used to reuse objects. When all operations have been performed, + /// then the collected information can be used to transfer the ids assigned to the created + /// database instances back to the data model or to clean up orphans. + /// + internal class PersistenceRegistry + { + private readonly Dictionary failureMechanismSections = + CreateDictionary(); + + private readonly Dictionary dikeProfiles = + CreateDictionary(); + + private readonly Dictionary foreshoreProfiles = + CreateDictionary(); + + private readonly Dictionary grassCoverErosionInwardsCalculations = + CreateDictionary(); + + private readonly Dictionary pipingStochasticSoilModels = + CreateDictionary(); + + private readonly Dictionary pipingStochasticSoilProfiles = + CreateDictionary(); + + private readonly Dictionary pipingSoilProfiles = + CreateDictionary(); + + private readonly Dictionary pipingSurfaceLines = + CreateDictionary(); + + private readonly Dictionary macroStabilityInwardsStochasticSoilModels = + CreateDictionary(); + + private readonly Dictionary macroStabilityInwardsStochasticSoilProfiles = + CreateDictionary(); + + private readonly Dictionary macroStabilityInwardsSoil1DProfiles = + CreateDictionary(); + + private readonly Dictionary macroStabilityInwardsSoil2DProfiles = + CreateDictionary(); + + private readonly Dictionary macroStabilityInwardsSurfaceLines = + CreateDictionary(); + + private readonly Dictionary hydraulicLocations = + CreateDictionary(); + + private readonly Dictionary duneLocations = + CreateDictionary(); + + private readonly Dictionary heightStructures = + CreateDictionary(); + + private readonly Dictionary closingStructures = + CreateDictionary(); + + private readonly Dictionary stabilityPointStructures = + CreateDictionary(); + + private readonly Dictionary> heightStructuresCalculations = + CreateDictionary>(); + + private readonly Dictionary> closingStructuresCalculations = + CreateDictionary>(); + + private readonly Dictionary> stabilityPointStructuresCalculations = + CreateDictionary>(); + + private static Dictionary CreateDictionary() + { + return new Dictionary(new ReferenceEqualityComparer()); + } + + private bool ContainsValue(Dictionary collection, TModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + return collection.Values.Contains(model, new ReferenceEqualityComparer()); + } + + private void Register(Dictionary collection, TEntity entity, TModel model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + collection[entity] = model; + } + + private TEntity Get(Dictionary collection, TModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + return collection.Keys.Single(k => ReferenceEquals(collection[k], model)); + } + + #region Register Methods + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The + /// to be registered. + /// The to + /// be registered. + /// Thrown when any of the input parameters is null. + internal void Register(GrassCoverErosionInwardsCalculationEntity entity, GrassCoverErosionInwardsCalculation model) + { + Register(grassCoverErosionInwardsCalculations, entity, model); + } + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The to be registered. + /// The to be registered. + /// Thrown when any of the input parameters is null. + internal void Register(FailureMechanismSectionEntity entity, FailureMechanismSection model) + { + Register(failureMechanismSections, entity, model); + } + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The to be registered. + /// The to be registered. + /// Thrown when any of the input parameters is null. + internal void Register(DikeProfileEntity entity, DikeProfile model) + { + Register(dikeProfiles, entity, model); + } + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The to be registered. + /// The to be registered. + /// Thrown when any of the input parameters is null. + internal void Register(ForeshoreProfileEntity entity, ForeshoreProfile model) + { + Register(foreshoreProfiles, entity, model); + } + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The to be registered. + /// The to be registered. + /// Thrown when any of the input parameters is null. + internal void Register(HydraulicLocationEntity entity, HydraulicBoundaryLocation model) + { + Register(hydraulicLocations, entity, model); + } + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The to be registered. + /// The to be registered. + /// Thrown when any of the input parameters is null. + internal void Register(DuneLocationEntity entity, DuneLocation model) + { + Register(duneLocations, entity, model); + } + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The to be registered. + /// The to be registered. + /// Thrown when any of the input parameters is null. + internal void Register(StochasticSoilModelEntity entity, PipingStochasticSoilModel model) + { + Register(pipingStochasticSoilModels, entity, model); + } + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The to be registered. + /// The to be registered. + /// Thrown when any of the input parameters is null. + internal void Register(PipingStochasticSoilProfileEntity entity, PipingStochasticSoilProfile model) + { + Register(pipingStochasticSoilProfiles, entity, model); + } + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The to be registered. + /// The to be registered. + /// Thrown when any of the input parameters is null. + internal void Register(PipingSoilProfileEntity entity, PipingSoilProfile model) + { + Register(pipingSoilProfiles, entity, model); + } + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The to be registered. + /// The to be registered. + /// Thrown when any of the input parameters is null. + internal void Register(SurfaceLineEntity entity, PipingSurfaceLine model) + { + Register(pipingSurfaceLines, entity, model); + } + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The to be registered. + /// The to be registered. + /// Thrown when any of the input parameters is null. + internal void Register(StochasticSoilModelEntity entity, MacroStabilityInwardsStochasticSoilModel model) + { + Register(macroStabilityInwardsStochasticSoilModels, entity, model); + } + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The to be registered. + /// The to be registered. + /// Thrown when any of the input parameters is null. + internal void Register(MacroStabilityInwardsStochasticSoilProfileEntity entity, MacroStabilityInwardsStochasticSoilProfile model) + { + Register(macroStabilityInwardsStochasticSoilProfiles, entity, model); + } + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The to be registered. + /// The to be registered. + /// Thrown when any of the input parameters is null. + internal void Register(MacroStabilityInwardsSoilProfileOneDEntity entity, MacroStabilityInwardsSoilProfile1D model) + { + Register(macroStabilityInwardsSoil1DProfiles, entity, model); + } + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The to be registered. + /// The to be registered. + /// Thrown when any of the input parameters is null. + internal void Register(MacroStabilityInwardsSoilProfileTwoDEntity entity, MacroStabilityInwardsSoilProfile2D model) + { + Register(macroStabilityInwardsSoil2DProfiles, entity, model); + } + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The to be registered. + /// The to be registered. + /// Thrown when any of the input parameters is null. + internal void Register(SurfaceLineEntity entity, MacroStabilityInwardsSurfaceLine model) + { + Register(macroStabilityInwardsSurfaceLines, entity, model); + } + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The to be registered. + /// The to be registered. + /// Thrown when any of the input parameters is null. + internal void Register(HeightStructureEntity entity, HeightStructure model) + { + Register(heightStructures, entity, model); + } + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The to be registered. + /// The to be registered. + /// Thrown when any of the input parameters is null. + internal void Register(ClosingStructureEntity entity, ClosingStructure model) + { + Register(closingStructures, entity, model); + } + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The to be registered. + /// The to be registered. + /// Thrown when any of the input parameters is null. + internal void Register(StabilityPointStructureEntity entity, StabilityPointStructure model) + { + Register(stabilityPointStructures, entity, model); + } + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The + /// to be registered. + /// The to + /// be registered. + /// Thrown when any input parameter is null. + internal void Register(HeightStructuresCalculationEntity entity, StructuresCalculation model) + { + Register(heightStructuresCalculations, entity, model); + } + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The + /// to be registered. + /// The to + /// be registered. + /// Thrown when any input parameter is null. + internal void Register(ClosingStructuresCalculationEntity entity, StructuresCalculation model) + { + Register(closingStructuresCalculations, entity, model); + } + + /// + /// Registers a create operation for and the + /// that was constructed with the information. + /// + /// The + /// to be registered. + /// The to + /// be registered. + /// Thrown when any input parameter is null. + internal void Register(StabilityPointStructuresCalculationEntity entity, StructuresCalculation model) + { + Register(stabilityPointStructuresCalculations, entity, model); + } + + #endregion + + #region Contains Methods + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(PipingStochasticSoilModel model) + { + return ContainsValue(pipingStochasticSoilModels, model); + } + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(PipingStochasticSoilProfile model) + { + return ContainsValue(pipingStochasticSoilProfiles, model); + } + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(PipingSoilProfile model) + { + return ContainsValue(pipingSoilProfiles, model); + } + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(PipingSurfaceLine model) + { + return ContainsValue(pipingSurfaceLines, model); + } + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(MacroStabilityInwardsStochasticSoilModel model) + { + return ContainsValue(macroStabilityInwardsStochasticSoilModels, model); + } + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(MacroStabilityInwardsStochasticSoilProfile model) + { + return ContainsValue(macroStabilityInwardsStochasticSoilProfiles, model); + } + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(MacroStabilityInwardsSoilProfile1D model) + { + return ContainsValue(macroStabilityInwardsSoil1DProfiles, model); + } + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(MacroStabilityInwardsSoilProfile2D model) + { + return ContainsValue(macroStabilityInwardsSoil2DProfiles, model); + } + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(MacroStabilityInwardsSurfaceLine model) + { + return ContainsValue(macroStabilityInwardsSurfaceLines, model); + } + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(HydraulicBoundaryLocation model) + { + return ContainsValue(hydraulicLocations, model); + } + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(DuneLocation model) + { + return ContainsValue(duneLocations, model); + } + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(FailureMechanismSection model) + { + return ContainsValue(failureMechanismSections, model); + } + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(DikeProfile model) + { + return ContainsValue(dikeProfiles, model); + } + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(ForeshoreProfile model) + { + return ContainsValue(foreshoreProfiles, model); + } + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(HeightStructure model) + { + return ContainsValue(heightStructures, model); + } + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(GrassCoverErosionInwardsCalculation model) + { + return ContainsValue(grassCoverErosionInwardsCalculations, model); + } + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(ClosingStructure model) + { + return ContainsValue(closingStructures, model); + } + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(StabilityPointStructure model) + { + return ContainsValue(stabilityPointStructures, model); + } + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(StructuresCalculation model) + { + return ContainsValue(heightStructuresCalculations, model); + } + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(StructuresCalculation model) + { + return ContainsValue(closingStructuresCalculations, model); + } + + /// + /// Checks whether a create operations has been registered for the given . + /// + /// The to check for. + /// true if the was registered before, false otherwise. + /// Thrown when is null. + internal bool Contains(StructuresCalculation model) + { + return ContainsValue(stabilityPointStructuresCalculations, model); + } + + #endregion + + #region Get Methods + + /// + /// Obtains the which was registered for the + /// given . + /// + /// The for which a read operation + /// has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out whether a create + /// operation has been registered for . + public ForeshoreProfileEntity Get(ForeshoreProfile model) + { + return Get(foreshoreProfiles, model); + } + + /// + /// Obtains the which was registered for + /// the given . + /// + /// The for which a create + /// operation has been registered. + /// The created . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out whether + /// a create operation has been registered for . + internal StochasticSoilModelEntity Get(PipingStochasticSoilModel model) + { + return Get(pipingStochasticSoilModels, model); + } + + /// + /// Obtains the which was registered for + /// the given . + /// + /// The for which a create + /// operation has been registered. + /// The created . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out whether + /// a create/create operation has been registered for . + internal PipingStochasticSoilProfileEntity Get(PipingStochasticSoilProfile model) + { + return Get(pipingStochasticSoilProfiles, model); + } + + /// + /// Obtains the which was registered for the given + /// . + /// + /// The for which a create + /// operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out whether a + /// create operation has been registered for . + internal PipingSoilProfileEntity Get(PipingSoilProfile model) + { + return Get(pipingSoilProfiles, model); + } + + /// + /// Obtains the which was registered for the given + /// . + /// + /// The for which a + /// read operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out + /// whether a create operation has been registered for . + internal SurfaceLineEntity Get(PipingSurfaceLine model) + { + return Get(pipingSurfaceLines, model); + } + + /// + /// Obtains the which was registered for + /// the given . + /// + /// The for which a create + /// operation has been registered. + /// The created . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out whether + /// a create operation has been registered for . + internal StochasticSoilModelEntity Get(MacroStabilityInwardsStochasticSoilModel model) + { + return Get(macroStabilityInwardsStochasticSoilModels, model); + } + + /// + /// Obtains the which was registered for + /// the given . + /// + /// The for which a create + /// operation has been registered. + /// The created . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out whether + /// a create/create operation has been registered for . + internal MacroStabilityInwardsStochasticSoilProfileEntity Get(MacroStabilityInwardsStochasticSoilProfile model) + { + return Get(macroStabilityInwardsStochasticSoilProfiles, model); + } + + /// + /// Obtains the which was registered for the given + /// . + /// + /// The for which a create + /// operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out whether a + /// create operation has been registered for . + internal MacroStabilityInwardsSoilProfileOneDEntity Get(MacroStabilityInwardsSoilProfile1D model) + { + return Get(macroStabilityInwardsSoil1DProfiles, model); + } + + /// + /// Obtains the which was registered for the given + /// . + /// + /// The for which a create + /// operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out whether a + /// create operation has been registered for . + internal MacroStabilityInwardsSoilProfileTwoDEntity Get(MacroStabilityInwardsSoilProfile2D model) + { + return Get(macroStabilityInwardsSoil2DProfiles, model); + } + + /// + /// Obtains the which was registered for the given + /// . + /// + /// The for which a + /// read operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out + /// whether a create operation has been registered for . + internal SurfaceLineEntity Get(MacroStabilityInwardsSurfaceLine model) + { + return Get(macroStabilityInwardsSurfaceLines, model); + } + + /// + /// Obtains the which was registered for the + /// given . + /// + /// The for which a + /// read operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out + /// whether a create operation has been registered for . + internal HydraulicLocationEntity Get(HydraulicBoundaryLocation model) + { + return Get(hydraulicLocations, model); + } + + /// + /// Obtains the which was registered for the + /// given . + /// + /// The for which a + /// read operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out + /// whether a create operation has been registered for . + internal DuneLocationEntity Get(DuneLocation model) + { + return Get(duneLocations, model); + } + + /// + /// Obtains the which was registered for the + /// given . + /// + /// The for which a + /// read operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out + /// whether a create operation has been registered for . + internal FailureMechanismSectionEntity Get(FailureMechanismSection model) + { + return Get(failureMechanismSections, model); + } + + /// + /// Obtains the which was registered for the + /// given . + /// + /// The for which a read operation + /// has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out whether a create + /// operation has been registered for . + internal DikeProfileEntity Get(DikeProfile model) + { + return Get(dikeProfiles, model); + } + + /// + /// Obtains the which was + /// registered for the given . + /// + /// The for + /// which a read operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out + /// whether a create operation has been registered for . + internal GrassCoverErosionInwardsCalculationEntity Get(GrassCoverErosionInwardsCalculation model) + { + return Get(grassCoverErosionInwardsCalculations, model); + } + + /// + /// Obtains the which was registered for the + /// given . + /// + /// The for which a read operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out whether a + /// create operation has been registered for . + internal HeightStructureEntity Get(HeightStructure model) + { + return Get(heightStructures, model); + } + + /// + /// Obtains the which was registered for the + /// given . + /// + /// The for which a read operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out whether a + /// create operation has been registered for . + internal ClosingStructureEntity Get(ClosingStructure model) + { + return Get(closingStructures, model); + } + + /// + /// Obtains the which was registered for the + /// given . + /// + /// The for which a read operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out whether a + /// create operation has been registered for . + internal StabilityPointStructureEntity Get(StabilityPointStructure model) + { + return Get(stabilityPointStructures, model); + } + + /// + /// Obtains the which was + /// registered for the given . + /// + /// The for + /// which a read operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out + /// whether a create operation has been registered for . + internal HeightStructuresCalculationEntity Get(StructuresCalculation model) + { + return Get(heightStructuresCalculations, model); + } + + /// + /// Obtains the which was + /// registered for the given . + /// + /// The for + /// which a read operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out + /// whether a create operation has been registered for . + internal ClosingStructuresCalculationEntity Get(StructuresCalculation model) + { + return Get(closingStructuresCalculations, model); + } + + /// + /// Obtains the which was + /// registered for the given . + /// + /// The for + /// which a read operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no create operation + /// has been registered for . + /// Use to find out + /// whether a create operation has been registered for . + internal StabilityPointStructuresCalculationEntity Get(StructuresCalculation model) + { + return Get(stabilityPointStructuresCalculations, model); + } + + #endregion + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingCalculationScenarioCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingCalculationScenarioCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingCalculationScenarioCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,107 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.Piping.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.Piping +{ + /// + /// Extension methods for related to creating + /// a . + /// + internal static class PipingCalculationScenarioCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The piping calculation to create a database entity for. + /// The object keeping track of create operations. + /// The index at which resides within its parent. + /// A new . + /// Thrown when is null. + public static PipingCalculationEntity Create(this PipingCalculationScenario calculation, PersistenceRegistry registry, int order) + { + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var entity = new PipingCalculationEntity + { + RelevantForScenario = Convert.ToByte(calculation.IsRelevant), + ScenarioContribution = calculation.Contribution.ToNaNAsNull(), + Name = calculation.Name.DeepClone(), + Comments = calculation.Comments.Body.DeepClone(), + Order = order + }; + SetInputParametersToEntity(entity, calculation.InputParameters, registry); + AddEntityForPipingOutput(entity, calculation.Output); + + return entity; + } + + private static void SetInputParametersToEntity(PipingCalculationEntity entity, PipingInput inputParameters, PersistenceRegistry registry) + { + if (inputParameters.SurfaceLine != null) + { + entity.SurfaceLineEntity = registry.Get(inputParameters.SurfaceLine); + } + + SetHydraulicBoundaryLocationInputToEntity(entity, inputParameters, registry); + + if (inputParameters.StochasticSoilProfile != null) + { + entity.PipingStochasticSoilProfileEntity = registry.Get(inputParameters.StochasticSoilProfile); + } + + entity.ExitPointL = inputParameters.ExitPointL.Value.ToNaNAsNull(); + entity.EntryPointL = inputParameters.EntryPointL.Value.ToNaNAsNull(); + + entity.PhreaticLevelExitMean = inputParameters.PhreaticLevelExit.Mean.ToNaNAsNull(); + entity.PhreaticLevelExitStandardDeviation = inputParameters.PhreaticLevelExit.StandardDeviation.ToNaNAsNull(); + + entity.DampingFactorExitMean = inputParameters.DampingFactorExit.Mean.ToNaNAsNull(); + entity.DampingFactorExitStandardDeviation = inputParameters.DampingFactorExit.StandardDeviation.ToNaNAsNull(); + } + + private static void SetHydraulicBoundaryLocationInputToEntity(PipingCalculationEntity entity, PipingInput inputParameters, PersistenceRegistry registry) + { + entity.UseAssessmentLevelManualInput = Convert.ToByte(inputParameters.UseAssessmentLevelManualInput); + entity.AssessmentLevel = inputParameters.AssessmentLevel.ToNaNAsNull(); + + if (inputParameters.HydraulicBoundaryLocation != null) + { + entity.HydraulicLocationEntity = registry.Get(inputParameters.HydraulicBoundaryLocation); + } + } + + private static void AddEntityForPipingOutput(PipingCalculationEntity entity, PipingOutput output) + { + if (output != null) + { + entity.PipingCalculationOutputEntities.Add(output.Create()); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingFailureMechanismCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingFailureMechanismCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingFailureMechanismCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,101 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Util.Extensions; +using Ringtoets.Piping.Data; +using Ringtoets.Piping.Data.SoilProfile; +using Ringtoets.Piping.Primitives; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.Piping +{ + /// + /// Extension methods for related to creating a . + /// + internal static class PipingFailureMechanismCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The failure mechanism to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static FailureMechanismEntity Create(this PipingFailureMechanism mechanism, PersistenceRegistry registry) + { + FailureMechanismEntity entity = mechanism.Create(FailureMechanismType.Piping, registry); + + AddEntitiesForFailureMechanismMeta(mechanism, entity); + AddEntitiesForStochasticSoilModels(mechanism, registry, entity); + AddEntitiesForSurfaceLines(mechanism, registry, entity); + AddEntitiesForSectionResults(mechanism.SectionResults, registry); + + entity.CalculationGroupEntity = mechanism.CalculationsGroup.Create(registry, 0); + + return entity; + } + + private static void AddEntitiesForSectionResults( + IEnumerable sectionResults, + PersistenceRegistry registry) + { + foreach (PipingFailureMechanismSectionResult pipingFailureMechanismSectionResult in sectionResults) + { + PipingSectionResultEntity pipingSectionResultEntity = pipingFailureMechanismSectionResult.Create(); + FailureMechanismSectionEntity section = registry.Get(pipingFailureMechanismSectionResult.Section); + section.PipingSectionResultEntities.Add(pipingSectionResultEntity); + } + } + + private static void AddEntitiesForFailureMechanismMeta(PipingFailureMechanism mechanism, FailureMechanismEntity entity) + { + var metaEntity = new PipingFailureMechanismMetaEntity + { + A = mechanism.PipingProbabilityAssessmentInput.A, + WaterVolumetricWeight = mechanism.GeneralInput.WaterVolumetricWeight, + StochasticSoilModelCollectionSourcePath = mechanism.StochasticSoilModels.SourcePath.DeepClone(), + SurfaceLineCollectionSourcePath = mechanism.SurfaceLines.SourcePath.DeepClone() + }; + + entity.PipingFailureMechanismMetaEntities.Add(metaEntity); + } + + private static void AddEntitiesForStochasticSoilModels(PipingFailureMechanism mechanism, PersistenceRegistry registry, FailureMechanismEntity entity) + { + var index = 0; + foreach (PipingStochasticSoilModel stochasticSoilModel in mechanism.StochasticSoilModels) + { + entity.StochasticSoilModelEntities.Add(stochasticSoilModel.Create(registry, index++)); + } + } + + private static void AddEntitiesForSurfaceLines(PipingFailureMechanism mechanism, PersistenceRegistry registry, FailureMechanismEntity entity) + { + var index = 0; + foreach (PipingSurfaceLine surfaceLine in mechanism.SurfaceLines) + { + entity.SurfaceLineEntities.Add(surfaceLine.Create(registry, index++)); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingFailureMechanismSectionResultCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingFailureMechanismSectionResultCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,60 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Piping.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.Piping +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class PipingFailureMechanismSectionResultCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The result to create a database entity for. + /// A new . + /// Thrown when is null. + internal static PipingSectionResultEntity Create(this PipingFailureMechanismSectionResult result) + { + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + var pipingSectionResultEntity = new PipingSectionResultEntity + { + SimpleAssessmentResult = Convert.ToByte(result.SimpleAssessmentResult), + DetailedAssessmentResult = Convert.ToByte(result.DetailedAssessmentResult), + TailorMadeAssessmentResult = Convert.ToByte(result.TailorMadeAssessmentResult), + TailorMadeAssessmentProbability = result.TailorMadeAssessmentProbability.ToNaNAsNull(), + UseManualAssembly = Convert.ToByte(result.UseManualAssembly), + ManualAssemblyProbability = result.ManualAssemblyProbability.ToNaNAsNull() + }; + + return pipingSectionResultEntity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingOutputCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingOutputCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingOutputCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,66 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Piping.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.Piping +{ + /// + /// Extension methods for related to creating a . + /// + internal static class PipingOutputCreateExtensions + { + /// + /// Creates a based on the information + /// of the . + /// + /// The calculation output for piping failure mechanism to + /// create a database entity for. + /// A new . + /// Thrown when + /// is null. + public static PipingCalculationOutputEntity Create(this PipingOutput output) + { + if (output == null) + { + throw new ArgumentNullException(nameof(output)); + } + + var entity = new PipingCalculationOutputEntity + { + HeaveFactorOfSafety = output.HeaveFactorOfSafety.ToNaNAsNull(), + HeaveZValue = output.HeaveZValue.ToNaNAsNull(), + SellmeijerFactorOfSafety = output.SellmeijerFactorOfSafety.ToNaNAsNull(), + SellmeijerZValue = output.SellmeijerZValue.ToNaNAsNull(), + UpliftFactorOfSafety = output.UpliftFactorOfSafety.ToNaNAsNull(), + UpliftZValue = output.UpliftZValue.ToNaNAsNull(), + UpliftEffectiveStress = output.UpliftEffectiveStress.ToNaNAsNull(), + HeaveGradient = output.HeaveGradient.ToNaNAsNull(), + SellmeijerCreepCoefficient = output.SellmeijerCreepCoefficient.ToNaNAsNull(), + SellmeijerCriticalFall = output.SellmeijerCriticalFall.ToNaNAsNull(), + SellmeijerReducedFall = output.SellmeijerReducedFall.ToNaNAsNull() + }; + return entity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingSoilLayerCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingSoilLayerCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingSoilLayerCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,65 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.Piping.Primitives; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.Piping +{ + /// + /// Extension methods for related to creating a . + /// + internal static class PipingSoilLayerCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The layer to create a database entity for. + /// Index at which this instance resides inside its parent container. + /// A new . + /// Thrown when is null. + public static PipingSoilLayerEntity Create(this PipingSoilLayer layer, int order) + { + if (layer == null) + { + throw new ArgumentNullException(nameof(layer)); + } + + return new PipingSoilLayerEntity + { + IsAquifer = Convert.ToByte(layer.IsAquifer), + Top = layer.Top.ToNaNAsNull(), + BelowPhreaticLevelMean = layer.BelowPhreaticLevel.Mean.ToNaNAsNull(), + BelowPhreaticLevelDeviation = layer.BelowPhreaticLevel.StandardDeviation.ToNaNAsNull(), + BelowPhreaticLevelShift = layer.BelowPhreaticLevel.Shift.ToNaNAsNull(), + DiameterD70Mean = layer.DiameterD70.Mean.ToNaNAsNull(), + DiameterD70CoefficientOfVariation = layer.DiameterD70.CoefficientOfVariation.ToNaNAsNull(), + PermeabilityMean = layer.Permeability.Mean.ToNaNAsNull(), + PermeabilityCoefficientOfVariation = layer.Permeability.CoefficientOfVariation.ToNaNAsNull(), + Color = layer.Color.ToInt64(), + MaterialName = layer.MaterialName.DeepClone(), + Order = order + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingSoilProfileCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingSoilProfileCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingSoilProfileCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,78 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.Piping.Primitives; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.Piping +{ + /// + /// Extension methods for related to creating a . + /// + internal static class PipingSoilProfileCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The profile to create a database entity for. + /// The object keeping track of create operations. + /// A new or one from the + /// if it was created for the earlier. + /// Thrown when is null. + internal static PipingSoilProfileEntity Create(this PipingSoilProfile profile, + PersistenceRegistry registry) + { + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + if (registry.Contains(profile)) + { + return registry.Get(profile); + } + + var entity = new PipingSoilProfileEntity + { + Name = profile.Name.DeepClone(), + Bottom = profile.Bottom.ToNaNAsNull(), + SourceType = Convert.ToByte(profile.SoilProfileSourceType) + }; + + AddEntitiesForPipingSoilLayers(profile, entity); + + registry.Register(entity, profile); + return entity; + } + + private static void AddEntitiesForPipingSoilLayers(PipingSoilProfile profile, + PipingSoilProfileEntity entity) + { + var index = 0; + foreach (PipingSoilLayer pipingSoilLayer in profile.Layers) + { + entity.PipingSoilLayerEntities.Add(pipingSoilLayer.Create(index++)); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingStochasticSoilModelCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingStochasticSoilModelCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingStochasticSoilModelCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,87 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.Piping.Data.SoilProfile; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Serializers; + +namespace Ringtoets.Storage.Core.Create.Piping +{ + /// + /// Extension methods for related to creating + /// a . + /// + internal static class PipingStochasticSoilModelCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The model to create a database entity for. + /// The object keeping track of create operations. + /// Index at which this instance resides inside its parent container. + /// A new . + /// Thrown when any input parameter is null. + internal static StochasticSoilModelEntity Create(this PipingStochasticSoilModel model, + PersistenceRegistry registry, + int order) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + if (registry.Contains(model)) + { + return registry.Get(model); + } + + var entity = new StochasticSoilModelEntity + { + Name = model.Name.DeepClone(), + StochasticSoilModelSegmentPointXml = new Point2DCollectionXmlSerializer().ToXml(model.Geometry), + Order = order + }; + + AddEntitiesForStochasticSoilProfiles(model, registry, entity); + + registry.Register(entity, model); + return entity; + } + + private static void AddEntitiesForStochasticSoilProfiles(PipingStochasticSoilModel model, + PersistenceRegistry registry, + StochasticSoilModelEntity entity) + { + var i = 0; + foreach (PipingStochasticSoilProfile stochasticSoilProfile in model.StochasticSoilProfiles) + { + entity.PipingStochasticSoilProfileEntities.Add(stochasticSoilProfile.Create(registry, i++)); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingStochasticSoilProfileCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingStochasticSoilProfileCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingStochasticSoilProfileCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Piping.Data.SoilProfile; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.Piping +{ + /// + /// Extension methods for related to creating + /// a . + /// + internal static class PipingStochasticSoilProfileCreateExtensions + { + /// + /// Creates a based on the information of the + /// . + /// + /// The profile to create a database entity for. + /// The object keeping track of create operations. + /// Index at which this instance resides inside its parent container. + /// A new . + /// Thrown when is null. + internal static PipingStochasticSoilProfileEntity Create(this PipingStochasticSoilProfile profile, + PersistenceRegistry registry, + int order) + { + var entity = new PipingStochasticSoilProfileEntity + { + Probability = profile.Probability, + PipingSoilProfileEntity = profile.SoilProfile.Create(registry), + Order = order + }; + if (registry.Contains(profile)) + { + return registry.Get(profile); + } + + registry.Register(entity, profile); + return entity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingSurfaceLineCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingSurfaceLineCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/Piping/PipingSurfaceLineCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,109 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Linq; +using Core.Common.Base.Geometry; +using Core.Common.Util.Extensions; +using Ringtoets.Piping.Primitives; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Serializers; + +namespace Ringtoets.Storage.Core.Create.Piping +{ + /// + /// Extensions methods for related to creating + /// a . + /// + internal static class PipingSurfaceLineCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The surface line to create a database entity for. + /// The object keeping track of create operations. + /// Index at which this instance resides inside its parent container. + /// A new . + /// Thrown when any input parameter is null. + internal static SurfaceLineEntity Create(this PipingSurfaceLine surfaceLine, PersistenceRegistry registry, int order) + { + if (surfaceLine == null) + { + throw new ArgumentNullException(nameof(surfaceLine)); + } + + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + if (registry.Contains(surfaceLine)) + { + return registry.Get(surfaceLine); + } + + var entity = new SurfaceLineEntity + { + Name = surfaceLine.Name.DeepClone(), + ReferenceLineIntersectionX = surfaceLine.ReferenceLineIntersectionWorldPoint?.X.ToNaNAsNull(), + ReferenceLineIntersectionY = surfaceLine.ReferenceLineIntersectionWorldPoint?.Y.ToNaNAsNull(), + PointsXml = new Point3DCollectionXmlSerializer().ToXml(surfaceLine.Points), + Order = order + }; + CreateCharacteristicPointEntities(surfaceLine, entity); + + registry.Register(entity, surfaceLine); + + return entity; + } + + private static void CreateCharacteristicPointEntities(PipingSurfaceLine surfaceLine, SurfaceLineEntity entity) + { + Tuple[] characteristicPointAssociations = + { + Tuple.Create(surfaceLine.BottomDitchPolderSide, PipingCharacteristicPointType.BottomDitchPolderSide), + Tuple.Create(surfaceLine.BottomDitchDikeSide, PipingCharacteristicPointType.BottomDitchDikeSide), + Tuple.Create(surfaceLine.DikeToeAtPolder, PipingCharacteristicPointType.DikeToeAtPolder), + Tuple.Create(surfaceLine.DikeToeAtRiver, PipingCharacteristicPointType.DikeToeAtRiver), + Tuple.Create(surfaceLine.DitchDikeSide, PipingCharacteristicPointType.DitchDikeSide), + Tuple.Create(surfaceLine.DitchPolderSide, PipingCharacteristicPointType.DitchPolderSide) + }; + foreach (Tuple characteristicPointToSave in characteristicPointAssociations.Where(t => t.Item1 != null)) + { + PipingCharacteristicPointEntity characteristicPointEntity = CreateCharacteristicPointEntity(characteristicPointToSave.Item1, + characteristicPointToSave.Item2); + entity.PipingCharacteristicPointEntities.Add(characteristicPointEntity); + } + } + + private static PipingCharacteristicPointEntity CreateCharacteristicPointEntity(Point3D point, PipingCharacteristicPointType type) + { + var entity = new PipingCharacteristicPointEntity + { + Type = Convert.ToByte(type), + X = point.X.ToNaNAsNull(), + Y = point.Y.ToNaNAsNull(), + Z = point.Z.ToNaNAsNull() + }; + return entity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/PipingStructure/PipingStructureFailureMechanismCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/PipingStructure/PipingStructureFailureMechanismCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/PipingStructure/PipingStructureFailureMechanismCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,73 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Ringtoets.Integration.Data.StandAlone; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.PipingStructure +{ + /// + /// Extension methods for related to creating a . + /// + internal static class PipingStructureFailureMechanismCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The failure mechanism to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static FailureMechanismEntity Create(this PipingStructureFailureMechanism mechanism, PersistenceRegistry registry) + { + FailureMechanismEntity entity = mechanism.Create(FailureMechanismType.PipingAtStructure, registry); + AddEntitiesForSectionResults(mechanism.SectionResults, registry); + AddEntitiesForFailureMechanismMeta(mechanism, entity); + return entity; + } + + private static void AddEntitiesForSectionResults( + IEnumerable sectionResults, + PersistenceRegistry registry) + { + foreach (PipingStructureFailureMechanismSectionResult failureMechanismSectionResult in sectionResults) + { + PipingStructureSectionResultEntity sectionResultEntity = failureMechanismSectionResult.Create(); + FailureMechanismSectionEntity section = registry.Get(failureMechanismSectionResult.Section); + section.PipingStructureSectionResultEntities.Add(sectionResultEntity); + } + } + + private static void AddEntitiesForFailureMechanismMeta(PipingStructureFailureMechanism failureMechanism, + FailureMechanismEntity entity) + { + var metaEntity = new PipingStructureFailureMechanismMetaEntity + { + N = failureMechanism.N + }; + + entity.PipingStructureFailureMechanismMetaEntities.Add(metaEntity); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/PipingStructure/PipingStructureFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/PipingStructure/PipingStructureFailureMechanismSectionResultCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/PipingStructure/PipingStructureFailureMechanismSectionResultCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,59 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.PipingStructure +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class PipingStructureFailureMechanismSectionResultCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The result to create a database entity for. + /// A new . + /// Thrown when is null. + internal static PipingStructureSectionResultEntity Create(this PipingStructureFailureMechanismSectionResult result) + { + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + var sectionResultEntity = new PipingStructureSectionResultEntity + { + SimpleAssessmentResult = Convert.ToByte(result.SimpleAssessmentResult), + DetailedAssessmentResult = Convert.ToByte(result.DetailedAssessmentResult), + TailorMadeAssessmentResult = Convert.ToByte(result.TailorMadeAssessmentResult), + UseManualAssembly = Convert.ToByte(result.UseManualAssembly), + ManualAssemblyCategoryGroup = Convert.ToByte(result.ManualAssemblyCategoryGroup) + }; + + return sectionResultEntity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/RiskeerProjectCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/RiskeerProjectCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/RiskeerProjectCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,67 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.Integration.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create +{ + /// + /// Extension methods for related to creating database entities. + /// + internal static class RiskeerProjectCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The project to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static ProjectEntity Create(this RingtoetsProject project, PersistenceRegistry registry) + { + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var entity = new ProjectEntity + { + Description = project.Description.DeepClone() + }; + + AddEntitiesForAssessmentSections(project, entity, registry); + + return entity; + } + + private static void AddEntitiesForAssessmentSections(RingtoetsProject project, ProjectEntity entity, PersistenceRegistry registry) + { + for (var index = 0; index < project.AssessmentSections.Count; index++) + { + AssessmentSection assessmentSection = project.AssessmentSections[index]; + entity.AssessmentSectionEntities.Add(assessmentSection.Create(registry, index)); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StabilityPointStructures/StabilityPointStructureCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StabilityPointStructures/StabilityPointStructureCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StabilityPointStructures/StabilityPointStructureCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,114 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.StabilityPointStructures.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.StabilityPointStructures +{ + /// + /// Extension methods for related to creating + /// a . + /// + internal static class StabilityPointStructureCreateExtensions + { + /// + /// Creates a based on the information + /// of the . + /// + /// The structure to create a database entity for. + /// The object keeping track of create operations. + /// The index at which resides within its parent. + /// A new . + /// Thrown when is null. + internal static StabilityPointStructureEntity Create(this StabilityPointStructure structure, PersistenceRegistry registry, int order) + { + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + if (registry.Contains(structure)) + { + return registry.Get(structure); + } + + var entity = new StabilityPointStructureEntity + { + Name = structure.Name.DeepClone(), + Id = structure.Id.DeepClone(), + X = structure.Location.X.ToNaNAsNull(), + Y = structure.Location.Y.ToNaNAsNull(), + StructureNormalOrientation = structure.StructureNormalOrientation.ToNaNAsNull(), + StorageStructureAreaMean = structure.StorageStructureArea.Mean.ToNaNAsNull(), + StorageStructureAreaCoefficientOfVariation = structure.StorageStructureArea.CoefficientOfVariation.ToNaNAsNull(), + AllowedLevelIncreaseStorageMean = structure.AllowedLevelIncreaseStorage.Mean.ToNaNAsNull(), + AllowedLevelIncreaseStorageStandardDeviation = structure.AllowedLevelIncreaseStorage.StandardDeviation.ToNaNAsNull(), + WidthFlowAperturesMean = structure.WidthFlowApertures.Mean.ToNaNAsNull(), + WidthFlowAperturesStandardDeviation = structure.WidthFlowApertures.StandardDeviation.ToNaNAsNull(), + InsideWaterLevelMean = structure.InsideWaterLevel.Mean.ToNaNAsNull(), + InsideWaterLevelStandardDeviation = structure.InsideWaterLevel.StandardDeviation.ToNaNAsNull(), + ThresholdHeightOpenWeirMean = structure.ThresholdHeightOpenWeir.Mean.ToNaNAsNull(), + ThresholdHeightOpenWeirStandardDeviation = structure.ThresholdHeightOpenWeir.StandardDeviation.ToNaNAsNull(), + CriticalOvertoppingDischargeMean = structure.CriticalOvertoppingDischarge.Mean.ToNaNAsNull(), + CriticalOvertoppingDischargeCoefficientOfVariation = structure.CriticalOvertoppingDischarge.CoefficientOfVariation.ToNaNAsNull(), + FlowWidthAtBottomProtectionMean = structure.FlowWidthAtBottomProtection.Mean.ToNaNAsNull(), + FlowWidthAtBottomProtectionStandardDeviation = structure.FlowWidthAtBottomProtection.StandardDeviation.ToNaNAsNull(), + ConstructiveStrengthLinearLoadModelMean = structure.ConstructiveStrengthLinearLoadModel.Mean.ToNaNAsNull(), + ConstructiveStrengthLinearLoadModelCoefficientOfVariation = structure.ConstructiveStrengthLinearLoadModel.CoefficientOfVariation.ToNaNAsNull(), + ConstructiveStrengthQuadraticLoadModelMean = structure.ConstructiveStrengthQuadraticLoadModel.Mean.ToNaNAsNull(), + ConstructiveStrengthQuadraticLoadModelCoefficientOfVariation = structure.ConstructiveStrengthQuadraticLoadModel.CoefficientOfVariation.ToNaNAsNull(), + BankWidthMean = structure.BankWidth.Mean.ToNaNAsNull(), + BankWidthStandardDeviation = structure.BankWidth.StandardDeviation.ToNaNAsNull(), + InsideWaterLevelFailureConstructionMean = structure.InsideWaterLevelFailureConstruction.Mean.ToNaNAsNull(), + InsideWaterLevelFailureConstructionStandardDeviation = structure.InsideWaterLevelFailureConstruction.StandardDeviation.ToNaNAsNull(), + EvaluationLevel = structure.EvaluationLevel.ToNaNAsNull(), + LevelCrestStructureMean = structure.LevelCrestStructure.Mean.ToNaNAsNull(), + LevelCrestStructureStandardDeviation = structure.LevelCrestStructure.StandardDeviation.ToNaNAsNull(), + VerticalDistance = structure.VerticalDistance.ToNaNAsNull(), + FailureProbabilityRepairClosure = structure.FailureProbabilityRepairClosure.ToNaNAsNull(), + FailureCollisionEnergyMean = structure.FailureCollisionEnergy.Mean.ToNaNAsNull(), + FailureCollisionEnergyCoefficientOfVariation = structure.FailureCollisionEnergy.CoefficientOfVariation.ToNaNAsNull(), + ShipMassMean = structure.ShipMass.Mean.ToNaNAsNull(), + ShipMassCoefficientOfVariation = structure.ShipMass.CoefficientOfVariation.ToNaNAsNull(), + ShipVelocityMean = structure.ShipVelocity.Mean.ToNaNAsNull(), + ShipVelocityCoefficientOfVariation = structure.ShipVelocity.CoefficientOfVariation.ToNaNAsNull(), + LevellingCount = structure.LevellingCount, + ProbabilityCollisionSecondaryStructure = structure.ProbabilityCollisionSecondaryStructure.ToNaNAsNull(), + FlowVelocityStructureClosableMean = structure.FlowVelocityStructureClosable.Mean.ToNaNAsNull(), + StabilityLinearLoadModelMean = structure.StabilityLinearLoadModel.Mean.ToNaNAsNull(), + StabilityLinearLoadModelCoefficientOfVariation = structure.StabilityLinearLoadModel.CoefficientOfVariation.ToNaNAsNull(), + StabilityQuadraticLoadModelMean = structure.StabilityQuadraticLoadModel.Mean.ToNaNAsNull(), + StabilityQuadraticLoadModelCoefficientOfVariation = structure.StabilityQuadraticLoadModel.CoefficientOfVariation.ToNaNAsNull(), + AreaFlowAperturesMean = structure.AreaFlowApertures.Mean.ToNaNAsNull(), + AreaFlowAperturesStandardDeviation = structure.AreaFlowApertures.StandardDeviation.ToNaNAsNull(), + InflowModelType = Convert.ToByte(structure.InflowModelType), + Order = order + }; + + registry.Register(entity, structure); + + return entity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StabilityPointStructures/StabilityPointStructuresFailureMechanismCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StabilityPointStructures/StabilityPointStructuresFailureMechanismCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StabilityPointStructures/StabilityPointStructuresFailureMechanismCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,105 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.StabilityPointStructures.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.StabilityPointStructures +{ + /// + /// Extension methods for related to creating a . + /// + internal static class StabilityPointStructuresFailureMechanismCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The failure mechanism to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static FailureMechanismEntity Create(this StabilityPointStructuresFailureMechanism mechanism, PersistenceRegistry registry) + { + FailureMechanismEntity entity = mechanism.Create(FailureMechanismType.StabilityPointStructures, registry); + AddEntitiesForForeshoreProfiles(mechanism.ForeshoreProfiles, entity, registry); + AddEntitiesForStabilityPointStructures(mechanism.StabilityPointStructures, entity, registry); + AddEntitiesForFailureMechanismMeta(mechanism, entity); + entity.CalculationGroupEntity = mechanism.CalculationsGroup.Create(registry, 0); + AddEntitiesForSectionResults(mechanism.SectionResults, registry); + + return entity; + } + + private static void AddEntitiesForSectionResults( + IEnumerable sectionResults, + PersistenceRegistry registry) + { + foreach (StabilityPointStructuresFailureMechanismSectionResult failureMechanismSectionResult in sectionResults) + { + StabilityPointStructuresSectionResultEntity sectionResultEntity = failureMechanismSectionResult.Create(registry); + FailureMechanismSectionEntity section = registry.Get(failureMechanismSectionResult.Section); + section.StabilityPointStructuresSectionResultEntities.Add(sectionResultEntity); + } + } + + private static void AddEntitiesForForeshoreProfiles( + ForeshoreProfileCollection foreshoreProfiles, + FailureMechanismEntity entity, + PersistenceRegistry registry) + { + for (var i = 0; i < foreshoreProfiles.Count; i++) + { + ForeshoreProfileEntity foreshoreProfileEntity = foreshoreProfiles[i].Create(registry, i); + entity.ForeshoreProfileEntities.Add(foreshoreProfileEntity); + } + } + + private static void AddEntitiesForStabilityPointStructures( + StructureCollection structures, + FailureMechanismEntity entity, + PersistenceRegistry registry) + { + for (var i = 0; i < structures.Count; i++) + { + StabilityPointStructureEntity structureEntity = structures[i].Create(registry, i); + entity.StabilityPointStructureEntities.Add(structureEntity); + } + } + + private static void AddEntitiesForFailureMechanismMeta( + StabilityPointStructuresFailureMechanism failureMechanism, + FailureMechanismEntity entity) + { + var metaEntity = new StabilityPointStructuresFailureMechanismMetaEntity + { + ForeshoreProfileCollectionSourcePath = failureMechanism.ForeshoreProfiles.SourcePath.DeepClone(), + StabilityPointStructureCollectionSourcePath = failureMechanism.StabilityPointStructures.SourcePath.DeepClone(), + N = failureMechanism.GeneralInput.N + }; + entity.StabilityPointStructuresFailureMechanismMetaEntities.Add(metaEntity); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StabilityPointStructures/StabilityPointStructuresFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StabilityPointStructures/StabilityPointStructuresFailureMechanismSectionResultCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StabilityPointStructures/StabilityPointStructuresFailureMechanismSectionResultCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,72 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.StabilityPointStructures.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.StabilityPointStructures +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class StabilityPointStructuresFailureMechanismSectionResultCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The result to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when any parameter is null. + internal static StabilityPointStructuresSectionResultEntity Create( + this StabilityPointStructuresFailureMechanismSectionResult result, + PersistenceRegistry registry) + { + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var sectionResultEntity = new StabilityPointStructuresSectionResultEntity + { + SimpleAssessmentResult = Convert.ToByte(result.SimpleAssessmentResult), + DetailedAssessmentResult = Convert.ToByte(result.DetailedAssessmentResult), + TailorMadeAssessmentResult = Convert.ToByte(result.TailorMadeAssessmentResult), + TailorMadeAssessmentProbability = result.TailorMadeAssessmentProbability.ToNaNAsNull(), + UseManualAssembly = Convert.ToByte(result.UseManualAssembly), + ManualAssemblyProbability = result.ManualAssemblyProbability.ToNaNAsNull() + }; + if (result.Calculation != null) + { + sectionResultEntity.StabilityPointStructuresCalculationEntity = registry.Get(result.Calculation); + } + + return sectionResultEntity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StabilityStoneCover/StabilityStoneCoverFailureMechanismCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StabilityStoneCover/StabilityStoneCoverFailureMechanismCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StabilityStoneCover/StabilityStoneCoverFailureMechanismCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,93 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.StabilityStoneCover.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.StabilityStoneCover +{ + /// + /// Extension methods for related to creating a . + /// + internal static class StabilityStoneCoverFailureMechanismCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The failure mechanism to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static FailureMechanismEntity Create(this StabilityStoneCoverFailureMechanism mechanism, PersistenceRegistry registry) + { + FailureMechanismEntity entity = mechanism.Create(FailureMechanismType.StabilityStoneRevetment, registry); + AddEntitiesForSectionResults(mechanism.SectionResults, registry); + AddEntitiesForFailureMechanismMeta(mechanism, entity); + AddEntitiesForForeshoreProfiles(mechanism.ForeshoreProfiles, entity, registry); + + entity.CalculationGroupEntity = mechanism.WaveConditionsCalculationGroup.Create(registry, 0); + + return entity; + } + + private static void AddEntitiesForSectionResults( + IEnumerable sectionResults, + PersistenceRegistry registry) + { + foreach (StabilityStoneCoverFailureMechanismSectionResult failureMechanismSectionResult in sectionResults) + { + StabilityStoneCoverSectionResultEntity sectionResultEntity = failureMechanismSectionResult.Create(); + FailureMechanismSectionEntity section = registry.Get(failureMechanismSectionResult.Section); + section.StabilityStoneCoverSectionResultEntities.Add(sectionResultEntity); + } + } + + private static void AddEntitiesForFailureMechanismMeta(StabilityStoneCoverFailureMechanism failureMechanism, + FailureMechanismEntity entity) + { + var metaEntity = new StabilityStoneCoverFailureMechanismMetaEntity + { + ForeshoreProfileCollectionSourcePath = failureMechanism.ForeshoreProfiles.SourcePath.DeepClone(), + N = failureMechanism.GeneralInput.N + }; + + entity.StabilityStoneCoverFailureMechanismMetaEntities.Add(metaEntity); + } + + private static void AddEntitiesForForeshoreProfiles( + IEnumerable foreshoreProfiles, + FailureMechanismEntity entity, + PersistenceRegistry registry) + { + var i = 0; + + foreach (ForeshoreProfile foreshoreProfile in foreshoreProfiles) + { + ForeshoreProfileEntity foreshoreProfileEntity = foreshoreProfile.Create(registry, i++); + entity.ForeshoreProfileEntities.Add(foreshoreProfileEntity); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StabilityStoneCover/StabilityStoneCoverFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StabilityStoneCover/StabilityStoneCoverFailureMechanismSectionResultCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StabilityStoneCover/StabilityStoneCoverFailureMechanismSectionResultCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,61 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.StabilityStoneCover.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.StabilityStoneCover +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class StabilityStoneCoverFailureMechanismSectionResultCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The result to create a database entity for. + /// A new . + /// Thrown when is null. + internal static StabilityStoneCoverSectionResultEntity Create(this StabilityStoneCoverFailureMechanismSectionResult result) + { + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + return new StabilityStoneCoverSectionResultEntity + { + SimpleAssessmentResult = Convert.ToByte(result.SimpleAssessmentResult), + DetailedAssessmentResultForFactorizedSignalingNorm = Convert.ToByte(result.DetailedAssessmentResultForFactorizedSignalingNorm), + DetailedAssessmentResultForSignalingNorm = Convert.ToByte(result.DetailedAssessmentResultForSignalingNorm), + DetailedAssessmentResultForMechanismSpecificLowerLimitNorm = Convert.ToByte(result.DetailedAssessmentResultForMechanismSpecificLowerLimitNorm), + DetailedAssessmentResultForLowerLimitNorm = Convert.ToByte(result.DetailedAssessmentResultForLowerLimitNorm), + DetailedAssessmentResultForFactorizedLowerLimitNorm = Convert.ToByte(result.DetailedAssessmentResultForFactorizedLowerLimitNorm), + TailorMadeAssessmentResult = Convert.ToByte(result.TailorMadeAssessmentResult), + UseManualAssembly = Convert.ToByte(result.UseManualAssembly), + ManualAssemblyCategoryGroup = Convert.ToByte(result.ManualAssemblyCategoryGroup) + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StabilityStoneCover/StabilityStoneCoverWaveConditionsCalculationCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StabilityStoneCover/StabilityStoneCoverWaveConditionsCalculationCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StabilityStoneCover/StabilityStoneCoverWaveConditionsCalculationCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,115 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.Revetment.Data; +using Ringtoets.StabilityStoneCover.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.StabilityStoneCover +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class StabilityStoneCoverWaveConditionsCalculationCreateExtensions + { + /// + /// Creates a based on the information of the + /// . + /// + /// The calculation to create a database entity for. + /// The object keeping track of create operations. + /// The index at which resides within its parent. + /// A new . + /// Thrown when any parameter is null. + internal static StabilityStoneCoverWaveConditionsCalculationEntity Create(this StabilityStoneCoverWaveConditionsCalculation calculation, + PersistenceRegistry registry, int order) + { + if (calculation == null) + { + throw new ArgumentNullException(nameof(calculation)); + } + + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var entity = new StabilityStoneCoverWaveConditionsCalculationEntity + { + Order = order, + Name = calculation.Name.DeepClone(), + Comments = calculation.Comments.Body.DeepClone() + }; + + SetInputParameters(entity, calculation.InputParameters, registry); + SetOutputEntities(entity, calculation); + + return entity; + } + + private static void SetInputParameters(StabilityStoneCoverWaveConditionsCalculationEntity entity, + AssessmentSectionCategoryWaveConditionsInput calculationInput, + PersistenceRegistry registry) + { + if (calculationInput.HydraulicBoundaryLocation != null) + { + entity.HydraulicLocationEntity = calculationInput.HydraulicBoundaryLocation.Create(registry, 0); + } + + if (calculationInput.ForeshoreProfile != null) + { + entity.ForeshoreProfileEntity = calculationInput.ForeshoreProfile.Create(registry, 0); + } + + entity.Orientation = calculationInput.Orientation.ToNaNAsNull(); + entity.UseBreakWater = Convert.ToByte(calculationInput.UseBreakWater); + entity.BreakWaterType = Convert.ToByte(calculationInput.BreakWater.Type); + entity.BreakWaterHeight = calculationInput.BreakWater.Height.ToNaNAsNull(); + entity.UseForeshore = Convert.ToByte(calculationInput.UseForeshore); + entity.UpperBoundaryRevetment = calculationInput.UpperBoundaryRevetment.ToNaNAsNull(); + entity.LowerBoundaryRevetment = calculationInput.LowerBoundaryRevetment.ToNaNAsNull(); + entity.UpperBoundaryWaterLevels = calculationInput.UpperBoundaryWaterLevels.ToNaNAsNull(); + entity.LowerBoundaryWaterLevels = calculationInput.LowerBoundaryWaterLevels.ToNaNAsNull(); + entity.StepSize = Convert.ToByte(calculationInput.StepSize); + entity.CategoryType = Convert.ToByte(calculationInput.CategoryType); + } + + private static void SetOutputEntities(StabilityStoneCoverWaveConditionsCalculationEntity entity, StabilityStoneCoverWaveConditionsCalculation calculation) + { + if (calculation.HasOutput) + { + var i = 0; + foreach (WaveConditionsOutput output in calculation.Output.BlocksOutput) + { + entity.StabilityStoneCoverWaveConditionsOutputEntities.Add(output.CreateStabilityStoneCoverWaveConditionsOutputEntity(WaveConditionsOutputType.Blocks, i++)); + } + + foreach (WaveConditionsOutput output in calculation.Output.ColumnsOutput) + { + entity.StabilityStoneCoverWaveConditionsOutputEntities.Add(output.CreateStabilityStoneCoverWaveConditionsOutputEntity(WaveConditionsOutputType.Columns, i++)); + } + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StrengthStabilityLengthwise/StrengthStabilityLengthwiseConstructionFailureMechanismCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StrengthStabilityLengthwise/StrengthStabilityLengthwiseConstructionFailureMechanismCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StrengthStabilityLengthwise/StrengthStabilityLengthwiseConstructionFailureMechanismCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Ringtoets.Integration.Data.StandAlone; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.StrengthStabilityLengthwise +{ + /// + /// Extension methods for related to creating a . + /// + internal static class StrengthStabilityLengthwiseConstructionFailureMechanismCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The failure mechanism to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static FailureMechanismEntity Create(this StrengthStabilityLengthwiseConstructionFailureMechanism mechanism, PersistenceRegistry registry) + { + FailureMechanismEntity entity = mechanism.Create(FailureMechanismType.StrengthAndStabilityParallelConstruction, registry); + AddEntitiesForSectionResults(mechanism.SectionResults, registry); + + return entity; + } + + private static void AddEntitiesForSectionResults( + IEnumerable sectionResults, + PersistenceRegistry registry) + { + foreach (StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult failureMechanismSectionResult in sectionResults) + { + StrengthStabilityLengthwiseConstructionSectionResultEntity sectionResultEntity = failureMechanismSectionResult.Create(); + FailureMechanismSectionEntity section = registry.Get(failureMechanismSectionResult.Section); + section.StrengthStabilityLengthwiseConstructionSectionResultEntities.Add(sectionResultEntity); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StrengthStabilityLengthwise/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StrengthStabilityLengthwise/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StrengthStabilityLengthwise/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,58 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.StrengthStabilityLengthwise +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The result to create a database entity for. + /// A new . + /// Thrown when is null. + internal static StrengthStabilityLengthwiseConstructionSectionResultEntity Create(this StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult result) + { + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + var sectionResultEntity = new StrengthStabilityLengthwiseConstructionSectionResultEntity + { + SimpleAssessmentResult = Convert.ToByte(result.SimpleAssessmentResult), + TailorMadeAssessmentResult = Convert.ToByte(result.TailorMadeAssessmentResult), + UseManualAssembly = Convert.ToByte(result.UseManualAssembly), + ManualAssemblyCategoryGroup = Convert.ToByte(result.ManualAssemblyCategoryGroup) + }; + + return sectionResultEntity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StructuresCalculationCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StructuresCalculationCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StructuresCalculationCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,359 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.ClosingStructures.Data; +using Ringtoets.Common.Data; +using Ringtoets.Common.Data.Structures; +using Ringtoets.HeightStructures.Data; +using Ringtoets.StabilityPointStructures.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create +{ + /// + /// Extension methods for related + /// to creating structures calculation entities. + /// + internal static class StructuresCalculationCreateExtensions + { + private static void Create(this StructuresInputBase input, IStructuresCalculationEntity entityToUpdate, + PersistenceRegistry registry) + where T : StructureBase + { + if (entityToUpdate == null) + { + throw new ArgumentNullException(nameof(entityToUpdate)); + } + + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + entityToUpdate.StormDurationMean = input.StormDuration.Mean.ToNaNAsNull(); + entityToUpdate.StructureNormalOrientation = input.StructureNormalOrientation.ToNaNAsNull(); + entityToUpdate.FailureProbabilityStructureWithErosion = input.FailureProbabilityStructureWithErosion; + + if (input.HydraulicBoundaryLocation != null) + { + entityToUpdate.HydraulicLocationEntity = registry.Get(input.HydraulicBoundaryLocation); + } + + if (input.ForeshoreProfile != null) + { + entityToUpdate.ForeshoreProfileEntity = registry.Get(input.ForeshoreProfile); + } + + entityToUpdate.UseForeshore = Convert.ToByte(input.UseForeshore); + + entityToUpdate.UseBreakWater = Convert.ToByte(input.UseBreakWater); + entityToUpdate.BreakWaterType = Convert.ToByte(input.BreakWater.Type); + entityToUpdate.BreakWaterHeight = input.BreakWater.Height.ToNaNAsNull(); + + entityToUpdate.AllowedLevelIncreaseStorageMean = input.AllowedLevelIncreaseStorage.Mean.ToNaNAsNull(); + entityToUpdate.AllowedLevelIncreaseStorageStandardDeviation = input.AllowedLevelIncreaseStorage.StandardDeviation.ToNaNAsNull(); + + entityToUpdate.StorageStructureAreaMean = input.StorageStructureArea.Mean.ToNaNAsNull(); + entityToUpdate.StorageStructureAreaCoefficientOfVariation = input.StorageStructureArea.CoefficientOfVariation.ToNaNAsNull(); + + entityToUpdate.FlowWidthAtBottomProtectionMean = input.FlowWidthAtBottomProtection.Mean.ToNaNAsNull(); + entityToUpdate.FlowWidthAtBottomProtectionStandardDeviation = input.FlowWidthAtBottomProtection.StandardDeviation.ToNaNAsNull(); + + entityToUpdate.CriticalOvertoppingDischargeMean = input.CriticalOvertoppingDischarge.Mean.ToNaNAsNull(); + entityToUpdate.CriticalOvertoppingDischargeCoefficientOfVariation = input.CriticalOvertoppingDischarge.CoefficientOfVariation.ToNaNAsNull(); + + entityToUpdate.WidthFlowAperturesMean = input.WidthFlowApertures.Mean.ToNaNAsNull(); + entityToUpdate.WidthFlowAperturesStandardDeviation = input.WidthFlowApertures.StandardDeviation.ToNaNAsNull(); + + entityToUpdate.ShouldIllustrationPointsBeCalculated = Convert.ToByte(input.ShouldIllustrationPointsBeCalculated); + } + + #region ClosingStructures + + /// + /// Creates a based + /// on the information of the . + /// + /// The calculation to create a database entity for. + /// The object keeping track of create operations. + /// The index at where resides + /// in its parent container. + /// A new . + /// Thrown when is null. + internal static ClosingStructuresCalculationEntity CreateForClosingStructures(this StructuresCalculation calculation, + PersistenceRegistry registry, int order) + { + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var entity = new ClosingStructuresCalculationEntity + { + Name = calculation.Name.DeepClone(), + Comments = calculation.Comments.Body.DeepClone(), + Order = order + }; + SetInputValues(entity, calculation.InputParameters, registry); + SetOutputEntity(calculation, entity); + + registry.Register(entity, calculation); + + return entity; + } + + private static void SetInputValues(ClosingStructuresCalculationEntity entity, ClosingStructuresInput input, + PersistenceRegistry registry) + { + input.Create(entity, registry); + + if (input.Structure != null) + { + entity.ClosingStructureEntity = registry.Get(input.Structure); + } + + entity.InflowModelType = Convert.ToByte(input.InflowModelType); + + entity.InsideWaterLevelMean = input.InsideWaterLevel.Mean.ToNaNAsNull(); + entity.InsideWaterLevelStandardDeviation = input.InsideWaterLevel.StandardDeviation.ToNaNAsNull(); + + entity.DeviationWaveDirection = input.DeviationWaveDirection.ToNaNAsNull(); + + entity.ModelFactorSuperCriticalFlowMean = input.ModelFactorSuperCriticalFlow.Mean.ToNaNAsNull(); + + entity.DrainCoefficientMean = input.DrainCoefficient.Mean.ToNaNAsNull(); + + entity.FactorStormDurationOpenStructure = input.FactorStormDurationOpenStructure.ToNaNAsNull(); + + entity.ThresholdHeightOpenWeirMean = input.ThresholdHeightOpenWeir.Mean.ToNaNAsNull(); + entity.ThresholdHeightOpenWeirStandardDeviation = input.ThresholdHeightOpenWeir.StandardDeviation.ToNaNAsNull(); + + entity.AreaFlowAperturesMean = input.AreaFlowApertures.Mean.ToNaNAsNull(); + entity.AreaFlowAperturesStandardDeviation = input.AreaFlowApertures.StandardDeviation.ToNaNAsNull(); + + entity.FailureProbabilityOpenStructure = input.FailureProbabilityOpenStructure; + + entity.FailureProbabilityReparation = input.FailureProbabilityReparation; + + entity.IdenticalApertures = input.IdenticalApertures; + + entity.LevelCrestStructureNotClosingMean = input.LevelCrestStructureNotClosing.Mean.ToNaNAsNull(); + entity.LevelCrestStructureNotClosingStandardDeviation = input.LevelCrestStructureNotClosing.StandardDeviation.ToNaNAsNull(); + + entity.ProbabilityOpenStructureBeforeFlooding = input.ProbabilityOpenStructureBeforeFlooding; + } + + private static void SetOutputEntity(StructuresCalculation calculation, + ClosingStructuresCalculationEntity entity) + { + if (calculation.HasOutput) + { + entity.ClosingStructuresOutputEntities.Add(calculation + .Output + .Create()); + } + } + + #endregion + + #region HeightStructures + + /// + /// Creates a based + /// on the information of the . + /// + /// The calculation to create a database entity for. + /// The object keeping track of create operations. + /// The index at where resides + /// in its parent container. + /// A new . + /// Thrown when is null. + internal static HeightStructuresCalculationEntity CreateForHeightStructures(this StructuresCalculation calculation, + PersistenceRegistry registry, int order) + { + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var entity = new HeightStructuresCalculationEntity + { + Name = calculation.Name.DeepClone(), + Comments = calculation.Comments.Body.DeepClone(), + Order = order + }; + SetInputValues(entity, calculation.InputParameters, registry); + SetOutputEntity(calculation, entity); + + registry.Register(entity, calculation); + + return entity; + } + + private static void SetInputValues(HeightStructuresCalculationEntity entity, HeightStructuresInput input, + PersistenceRegistry registry) + { + input.Create(entity, registry); + + if (input.Structure != null) + { + entity.HeightStructureEntity = registry.Get(input.Structure); + } + + entity.DeviationWaveDirection = input.DeviationWaveDirection.ToNaNAsNull(); + + entity.ModelFactorSuperCriticalFlowMean = input.ModelFactorSuperCriticalFlow.Mean.ToNaNAsNull(); + + entity.LevelCrestStructureMean = input.LevelCrestStructure.Mean.ToNaNAsNull(); + entity.LevelCrestStructureStandardDeviation = input.LevelCrestStructure.StandardDeviation.ToNaNAsNull(); + } + + private static void SetOutputEntity(StructuresCalculation calculation, + HeightStructuresCalculationEntity entity) + { + if (calculation.HasOutput) + { + entity.HeightStructuresOutputEntities.Add(calculation + .Output + .Create()); + } + } + + #endregion + + #region StabilityPointStructures + + /// + /// Creates a based + /// on the information of the . + /// + /// The calculation to create a database entity for. + /// The object keeping track of create operations. + /// The index at where resides + /// in its parent container. + /// A new . + /// Thrown when is null. + internal static StabilityPointStructuresCalculationEntity CreateForStabilityPointStructures(this StructuresCalculation calculation, + PersistenceRegistry registry, int order) + { + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var entity = new StabilityPointStructuresCalculationEntity + { + Name = calculation.Name.DeepClone(), + Comments = calculation.Comments.Body.DeepClone(), + Order = order + }; + SetInputValues(entity, calculation.InputParameters, registry); + SetOutputEntity(calculation, entity); + + registry.Register(entity, calculation); + + return entity; + } + + private static void SetInputValues(StabilityPointStructuresCalculationEntity entity, + StabilityPointStructuresInput input, PersistenceRegistry registry) + { + input.Create(entity, registry); + + if (input.Structure != null) + { + entity.StabilityPointStructureEntity = registry.Get(input.Structure); + } + + entity.InsideWaterLevelMean = input.InsideWaterLevel.Mean.ToNaNAsNull(); + entity.InsideWaterLevelStandardDeviation = input.InsideWaterLevel.StandardDeviation.ToNaNAsNull(); + + entity.ThresholdHeightOpenWeirMean = input.ThresholdHeightOpenWeir.Mean.ToNaNAsNull(); + entity.ThresholdHeightOpenWeirStandardDeviation = input.ThresholdHeightOpenWeir.StandardDeviation.ToNaNAsNull(); + + entity.ConstructiveStrengthLinearLoadModelMean = input.ConstructiveStrengthLinearLoadModel.Mean.ToNaNAsNull(); + entity.ConstructiveStrengthLinearLoadModelCoefficientOfVariation = input.ConstructiveStrengthLinearLoadModel.CoefficientOfVariation.ToNaNAsNull(); + + entity.ConstructiveStrengthQuadraticLoadModelMean = input.ConstructiveStrengthQuadraticLoadModel.Mean.ToNaNAsNull(); + entity.ConstructiveStrengthQuadraticLoadModelCoefficientOfVariation = input.ConstructiveStrengthQuadraticLoadModel.CoefficientOfVariation.ToNaNAsNull(); + + entity.BankWidthMean = input.BankWidth.Mean.ToNaNAsNull(); + entity.BankWidthStandardDeviation = input.BankWidth.StandardDeviation.ToNaNAsNull(); + + entity.InsideWaterLevelFailureConstructionMean = input.InsideWaterLevelFailureConstruction.Mean.ToNaNAsNull(); + entity.InsideWaterLevelFailureConstructionStandardDeviation = input.InsideWaterLevelFailureConstruction.StandardDeviation.ToNaNAsNull(); + + entity.EvaluationLevel = input.EvaluationLevel.ToNaNAsNull(); + + entity.LevelCrestStructureMean = input.LevelCrestStructure.Mean.ToNaNAsNull(); + entity.LevelCrestStructureStandardDeviation = input.LevelCrestStructure.StandardDeviation.ToNaNAsNull(); + + entity.VerticalDistance = input.VerticalDistance.ToNaNAsNull(); + + entity.FailureProbabilityRepairClosure = input.FailureProbabilityRepairClosure; + + entity.FailureCollisionEnergyMean = input.FailureCollisionEnergy.Mean.ToNaNAsNull(); + entity.FailureCollisionEnergyCoefficientOfVariation = input.FailureCollisionEnergy.CoefficientOfVariation.ToNaNAsNull(); + + entity.ShipMassMean = input.ShipMass.Mean.ToNaNAsNull(); + entity.ShipMassCoefficientOfVariation = input.ShipMass.CoefficientOfVariation.ToNaNAsNull(); + + entity.ShipVelocityMean = input.ShipVelocity.Mean.ToNaNAsNull(); + entity.ShipVelocityCoefficientOfVariation = input.ShipVelocity.CoefficientOfVariation.ToNaNAsNull(); + + entity.LevellingCount = input.LevellingCount; + + entity.ProbabilityCollisionSecondaryStructure = input.ProbabilityCollisionSecondaryStructure; + + entity.FlowVelocityStructureClosableMean = input.FlowVelocityStructureClosable.Mean.ToNaNAsNull(); + + entity.StabilityLinearLoadModelMean = input.StabilityLinearLoadModel.Mean.ToNaNAsNull(); + entity.StabilityLinearLoadModelCoefficientOfVariation = input.StabilityLinearLoadModel.CoefficientOfVariation.ToNaNAsNull(); + + entity.StabilityQuadraticLoadModelMean = input.StabilityQuadraticLoadModel.Mean.ToNaNAsNull(); + entity.StabilityQuadraticLoadModelCoefficientOfVariation = input.StabilityQuadraticLoadModel.CoefficientOfVariation.ToNaNAsNull(); + + entity.AreaFlowAperturesMean = input.AreaFlowApertures.Mean.ToNaNAsNull(); + entity.AreaFlowAperturesStandardDeviation = input.AreaFlowApertures.StandardDeviation.ToNaNAsNull(); + + entity.InflowModelType = Convert.ToByte(input.InflowModelType); + entity.LoadSchematizationType = Convert.ToByte(input.LoadSchematizationType); + entity.VolumicWeightWater = input.VolumicWeightWater.ToNaNAsNull(); + entity.FactorStormDurationOpenStructure = input.FactorStormDurationOpenStructure.ToNaNAsNull(); + entity.DrainCoefficientMean = input.DrainCoefficient.Mean.ToNaNAsNull(); + } + + private static void SetOutputEntity(StructuresCalculation calculation, + StabilityPointStructuresCalculationEntity entity) + { + if (calculation.HasOutput) + { + entity.StabilityPointStructuresOutputEntities.Add(calculation + .Output + .Create()); + } + } + + #endregion + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StructuresOutputCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StructuresOutputCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/StructuresOutputCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,73 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Data.Structures; +using Ringtoets.Storage.Core.Create.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create +{ + /// + /// Extension methods for related to creating structures + /// calculation output entities. + /// + internal static class StructuresOutputCreateExtensions + { + /// + /// Creates a based on the information of the + /// . + /// + /// The structures output to create a database entity for. + /// A new . + /// Thrown when + /// is null. + public static TOutputEntity Create(this StructuresOutput structuresOutput) + where TOutputEntity : IStructuresOutputEntity, + IHasGeneralResultFaultTreeIllustrationPointEntity, + new() + { + if (structuresOutput == null) + { + throw new ArgumentNullException(nameof(structuresOutput)); + } + + var outputEntity = new TOutputEntity + { + Reliability = structuresOutput.Reliability.ToNaNAsNull() + }; + + SetGeneralResult(structuresOutput, outputEntity); + + return outputEntity; + } + + private static void SetGeneralResult(StructuresOutput structuresOutput, IHasGeneralResultFaultTreeIllustrationPointEntity outputEntity) + { + if (structuresOutput.HasGeneralResult) + { + outputEntity.GeneralResultFaultTreeIllustrationPointEntity = + structuresOutput.GeneralResult + .CreateGeneralResultFaultTreeIllustrationPointEntity(); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/TechnicalInnovation/TechnicalInnovationFailureMechanismCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/TechnicalInnovation/TechnicalInnovationFailureMechanismCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/TechnicalInnovation/TechnicalInnovationFailureMechanismCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Ringtoets.Integration.Data.StandAlone; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.TechnicalInnovation +{ + /// + /// Extension methods for related to creating a . + /// + internal static class TechnicalInnovationFailureMechanismCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The failure mechanism to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static FailureMechanismEntity Create(this TechnicalInnovationFailureMechanism mechanism, PersistenceRegistry registry) + { + FailureMechanismEntity entity = mechanism.Create(FailureMechanismType.TechnicalInnovations, registry); + AddEntitiesForSectionResults(mechanism.SectionResults, registry); + + return entity; + } + + private static void AddEntitiesForSectionResults( + IEnumerable sectionResults, + PersistenceRegistry registry) + { + foreach (TechnicalInnovationFailureMechanismSectionResult failureMechanismSectionResult in sectionResults) + { + TechnicalInnovationSectionResultEntity sectionResultEntity = failureMechanismSectionResult.Create(); + FailureMechanismSectionEntity section = registry.Get(failureMechanismSectionResult.Section); + section.TechnicalInnovationSectionResultEntities.Add(sectionResultEntity); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/TechnicalInnovation/TechnicalInnovationFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/TechnicalInnovation/TechnicalInnovationFailureMechanismSectionResultCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/TechnicalInnovation/TechnicalInnovationFailureMechanismSectionResultCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,58 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.TechnicalInnovation +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class TechnicalInnovationFailureMechanismSectionResultCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The result to create a database entity for. + /// A new . + /// Thrown when is null. + internal static TechnicalInnovationSectionResultEntity Create(this TechnicalInnovationFailureMechanismSectionResult result) + { + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + var sectionResultEntity = new TechnicalInnovationSectionResultEntity + { + SimpleAssessmentResult = Convert.ToByte(result.SimpleAssessmentResult), + TailorMadeAssessmentResult = Convert.ToByte(result.TailorMadeAssessmentResult), + UseManualAssembly = Convert.ToByte(result.UseManualAssembly), + ManualAssemblyCategoryGroup = Convert.ToByte(result.ManualAssemblyCategoryGroup) + }; + + return sectionResultEntity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/WaterPressureAsphaltCover/WaterPressureAsphaltCoverFailureMechanismCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/WaterPressureAsphaltCover/WaterPressureAsphaltCoverFailureMechanismCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/WaterPressureAsphaltCover/WaterPressureAsphaltCoverFailureMechanismCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Ringtoets.Integration.Data.StandAlone; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.WaterPressureAsphaltCover +{ + /// + /// Extension methods for related to creating a . + /// + internal static class WaterPressureAsphaltCoverFailureMechanismCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The failure mechanism to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static FailureMechanismEntity Create(this WaterPressureAsphaltCoverFailureMechanism mechanism, PersistenceRegistry registry) + { + FailureMechanismEntity entity = mechanism.Create(FailureMechanismType.WaterOverpressureAsphaltRevetment, registry); + AddEntitiesForSectionResults(mechanism.SectionResults, registry); + + return entity; + } + + private static void AddEntitiesForSectionResults( + IEnumerable sectionResults, + PersistenceRegistry registry) + { + foreach (WaterPressureAsphaltCoverFailureMechanismSectionResult failureMechanismSectionResult in sectionResults) + { + WaterPressureAsphaltCoverSectionResultEntity sectionResultEntity = failureMechanismSectionResult.Create(); + FailureMechanismSectionEntity section = registry.Get(failureMechanismSectionResult.Section); + section.WaterPressureAsphaltCoverSectionResultEntities.Add(sectionResultEntity); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/WaterPressureAsphaltCover/WaterPressureAsphaltCoverFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/WaterPressureAsphaltCover/WaterPressureAsphaltCoverFailureMechanismSectionResultCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/WaterPressureAsphaltCover/WaterPressureAsphaltCoverFailureMechanismSectionResultCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,58 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create.WaterPressureAsphaltCover +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class WaterPressureAsphaltCoverFailureMechanismSectionResultCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The result to create a database entity for. + /// A new . + /// Thrown when is null. + internal static WaterPressureAsphaltCoverSectionResultEntity Create(this WaterPressureAsphaltCoverFailureMechanismSectionResult result) + { + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + var sectionResultEntity = new WaterPressureAsphaltCoverSectionResultEntity + { + SimpleAssessmentResult = Convert.ToByte(result.SimpleAssessmentResult), + TailorMadeAssessmentResult = Convert.ToByte(result.TailorMadeAssessmentResult), + UseManualAssembly = Convert.ToByte(result.UseManualAssembly), + ManualAssemblyCategoryGroup = Convert.ToByte(result.ManualAssemblyCategoryGroup) + }; + + return sectionResultEntity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/WaveConditionsOutputCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/WaveConditionsOutputCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/WaveConditionsOutputCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,120 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Revetment.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Create +{ + /// + /// Extension methods for related to + /// creating entities for various failure mechanisms. + /// + internal static class WaveConditionsOutputCreateExtensions + { + /// + /// Creates a based on the information + /// of the . + /// + /// The calculation output for grass cover erosion outwards failure mechanism to + /// create a database entity for. + /// The position of in the list of all outputs. + /// A new . + internal static GrassCoverErosionOutwardsWaveConditionsOutputEntity CreateGrassCoverErosionOutwardsWaveConditionsOutputEntity( + this WaveConditionsOutput output, int order) + { + var entity = new GrassCoverErosionOutwardsWaveConditionsOutputEntity + { + Order = order, + WaterLevel = output.WaterLevel.ToNaNAsNull(), + WaveHeight = output.WaveHeight.ToNaNAsNull(), + WavePeakPeriod = output.WavePeakPeriod.ToNaNAsNull(), + WaveAngle = output.WaveAngle.ToNaNAsNull(), + WaveDirection = output.WaveDirection.ToNaNAsNull(), + TargetProbability = output.TargetProbability.ToNaNAsNull(), + TargetReliability = output.TargetReliability.ToNaNAsNull(), + CalculatedProbability = output.CalculatedProbability.ToNaNAsNull(), + CalculatedReliability = output.CalculatedReliability.ToNaNAsNull(), + CalculationConvergence = Convert.ToByte(output.CalculationConvergence) + }; + return entity; + } + + /// + /// Creates a based on the information + /// of the . + /// + /// The calculation output for stability stone cover failure mechanism to + /// create a database entity for. + /// The type of the . + /// The position of in the list of all outputs. + /// A new . + internal static StabilityStoneCoverWaveConditionsOutputEntity CreateStabilityStoneCoverWaveConditionsOutputEntity( + this WaveConditionsOutput output, WaveConditionsOutputType type, int order) + { + var entity = new StabilityStoneCoverWaveConditionsOutputEntity + { + Order = order, + WaterLevel = output.WaterLevel.ToNaNAsNull(), + WaveHeight = output.WaveHeight.ToNaNAsNull(), + WavePeakPeriod = output.WavePeakPeriod.ToNaNAsNull(), + WaveAngle = output.WaveAngle.ToNaNAsNull(), + OutputType = Convert.ToByte(type), + WaveDirection = output.WaveDirection.ToNaNAsNull(), + TargetProbability = output.TargetProbability.ToNaNAsNull(), + TargetReliability = output.TargetReliability.ToNaNAsNull(), + CalculatedProbability = output.CalculatedProbability.ToNaNAsNull(), + CalculatedReliability = output.CalculatedReliability.ToNaNAsNull(), + CalculationConvergence = Convert.ToByte(output.CalculationConvergence) + }; + return entity; + } + + /// + /// Creates a based on the information + /// of the . + /// + /// The calculation output for wave impact asphalt cover mechanism to + /// create a database entity for. + /// The position of in the list of all outputs. + /// A new . + internal static WaveImpactAsphaltCoverWaveConditionsOutputEntity CreateWaveImpactAsphaltCoverWaveConditionsOutputEntity( + this WaveConditionsOutput output, int order) + { + var entity = new WaveImpactAsphaltCoverWaveConditionsOutputEntity + { + Order = order, + WaterLevel = output.WaterLevel.ToNaNAsNull(), + WaveHeight = output.WaveHeight.ToNaNAsNull(), + WavePeakPeriod = output.WavePeakPeriod.ToNaNAsNull(), + WaveAngle = output.WaveAngle.ToNaNAsNull(), + WaveDirection = output.WaveDirection.ToNaNAsNull(), + TargetProbability = output.TargetProbability.ToNaNAsNull(), + TargetReliability = output.TargetReliability.ToNaNAsNull(), + CalculatedProbability = output.CalculatedProbability.ToNaNAsNull(), + CalculatedReliability = output.CalculatedReliability.ToNaNAsNull(), + CalculationConvergence = Convert.ToByte(output.CalculationConvergence) + }; + return entity; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverFailureMechanismCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverFailureMechanismCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverFailureMechanismCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,92 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.WaveImpactAsphaltCover.Data; + +namespace Ringtoets.Storage.Core.Create.WaveImpactAsphaltCover +{ + /// + /// Extension methods for related to creating a . + /// + internal static class WaveImpactAsphaltCoverFailureMechanismCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The failure mechanism to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static FailureMechanismEntity Create(this WaveImpactAsphaltCoverFailureMechanism mechanism, PersistenceRegistry registry) + { + FailureMechanismEntity entity = mechanism.Create(FailureMechanismType.WaveImpactOnAsphaltRevetment, registry); + AddEntitiesForSectionResults(mechanism.SectionResults, registry); + AddEntitiesForFailureMechanismMeta(mechanism, entity); + AddEntitiesForForeshoreProfiles(mechanism.ForeshoreProfiles, entity, registry); + entity.CalculationGroupEntity = mechanism.WaveConditionsCalculationGroup.Create(registry, 0); + + return entity; + } + + private static void AddEntitiesForSectionResults( + IEnumerable sectionResults, + PersistenceRegistry registry) + { + foreach (WaveImpactAsphaltCoverFailureMechanismSectionResult failureMechanismSectionResult in sectionResults) + { + WaveImpactAsphaltCoverSectionResultEntity sectionResultEntity = failureMechanismSectionResult.Create(); + FailureMechanismSectionEntity section = registry.Get(failureMechanismSectionResult.Section); + section.WaveImpactAsphaltCoverSectionResultEntities.Add(sectionResultEntity); + } + } + + private static void AddEntitiesForFailureMechanismMeta(WaveImpactAsphaltCoverFailureMechanism failureMechanism, + FailureMechanismEntity entity) + { + var metaEntity = new WaveImpactAsphaltCoverFailureMechanismMetaEntity + { + ForeshoreProfileCollectionSourcePath = failureMechanism.ForeshoreProfiles.SourcePath.DeepClone(), + DeltaL = failureMechanism.GeneralWaveImpactAsphaltCoverInput.DeltaL + }; + + entity.WaveImpactAsphaltCoverFailureMechanismMetaEntities.Add(metaEntity); + } + + private static void AddEntitiesForForeshoreProfiles( + IEnumerable foreshoreProfiles, + FailureMechanismEntity entity, + PersistenceRegistry registry) + { + var i = 0; + + foreach (ForeshoreProfile foreshoreProfile in foreshoreProfiles) + { + ForeshoreProfileEntity foreshoreProfileEntity = foreshoreProfile.Create(registry, i++); + entity.ForeshoreProfileEntities.Add(foreshoreProfileEntity); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverFailureMechanismSectionResultCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverFailureMechanismSectionResultCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.WaveImpactAsphaltCover.Data; + +namespace Ringtoets.Storage.Core.Create.WaveImpactAsphaltCover +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class WaveImpactAsphaltCoverFailureMechanismSectionResultCreateExtensions + { + /// + /// Creates a based on the information + /// of the . + /// + /// The result to create a database entity for. + /// A new . + /// Thrown when is null. + internal static WaveImpactAsphaltCoverSectionResultEntity Create(this WaveImpactAsphaltCoverFailureMechanismSectionResult result) + { + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + return new WaveImpactAsphaltCoverSectionResultEntity + { + SimpleAssessmentResult = Convert.ToByte(result.SimpleAssessmentResult), + DetailedAssessmentResultForFactorizedSignalingNorm = Convert.ToByte(result.DetailedAssessmentResultForFactorizedSignalingNorm), + DetailedAssessmentResultForSignalingNorm = Convert.ToByte(result.DetailedAssessmentResultForSignalingNorm), + DetailedAssessmentResultForMechanismSpecificLowerLimitNorm = Convert.ToByte(result.DetailedAssessmentResultForMechanismSpecificLowerLimitNorm), + DetailedAssessmentResultForLowerLimitNorm = Convert.ToByte(result.DetailedAssessmentResultForLowerLimitNorm), + DetailedAssessmentResultForFactorizedLowerLimitNorm = Convert.ToByte(result.DetailedAssessmentResultForFactorizedLowerLimitNorm), + TailorMadeAssessmentResult = Convert.ToByte(result.TailorMadeAssessmentResult), + UseManualAssembly = Convert.ToByte(result.UseManualAssembly), + ManualAssemblyCategoryGroup = Convert.ToByte(result.ManualAssemblyCategoryGroup) + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsCalculationCreateExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsCalculationCreateExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsCalculationCreateExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,113 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Revetment.Data; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.WaveImpactAsphaltCover.Data; + +namespace Ringtoets.Storage.Core.Create.WaveImpactAsphaltCover +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class WaveImpactAsphaltCoverWaveConditionsCalculationCreateExtensions + { + /// + /// Creates a based on the information of the + /// . + /// + /// The calculation to create a database entity for. + /// The object keeping track of create operations. + /// The index at which resides within its parent. + /// A new . + /// Thrown when any parameter is null. + internal static WaveImpactAsphaltCoverWaveConditionsCalculationEntity Create(this WaveImpactAsphaltCoverWaveConditionsCalculation calculation, + PersistenceRegistry registry, int order) + { + if (calculation == null) + { + throw new ArgumentNullException(nameof(calculation)); + } + + if (registry == null) + { + throw new ArgumentNullException(nameof(registry)); + } + + var entity = new WaveImpactAsphaltCoverWaveConditionsCalculationEntity + { + Order = order, + Name = calculation.Name.DeepClone(), + Comments = calculation.Comments.Body.DeepClone() + }; + + SetInputParameters(entity, calculation.InputParameters, registry); + AddEntityForWaveImpactAsphaltCoverWaveConditionsOutput(calculation, entity); + + return entity; + } + + private static void SetInputParameters(WaveImpactAsphaltCoverWaveConditionsCalculationEntity entity, + AssessmentSectionCategoryWaveConditionsInput calculationInput, + PersistenceRegistry registry) + { + HydraulicBoundaryLocation hydraulicBoundaryLocation = calculationInput.HydraulicBoundaryLocation; + if (hydraulicBoundaryLocation != null) + { + entity.HydraulicLocationEntity = hydraulicBoundaryLocation.Create(registry, 0); + } + + if (calculationInput.ForeshoreProfile != null) + { + entity.ForeshoreProfileEntity = calculationInput.ForeshoreProfile.Create(registry, 0); + } + + entity.Orientation = calculationInput.Orientation.ToNaNAsNull(); + entity.UseBreakWater = Convert.ToByte(calculationInput.UseBreakWater); + entity.BreakWaterType = Convert.ToByte(calculationInput.BreakWater.Type); + entity.BreakWaterHeight = calculationInput.BreakWater.Height.ToNaNAsNull(); + entity.UseForeshore = Convert.ToByte(calculationInput.UseForeshore); + entity.UpperBoundaryRevetment = calculationInput.UpperBoundaryRevetment.ToNaNAsNull(); + entity.LowerBoundaryRevetment = calculationInput.LowerBoundaryRevetment.ToNaNAsNull(); + entity.UpperBoundaryWaterLevels = calculationInput.UpperBoundaryWaterLevels.ToNaNAsNull(); + entity.LowerBoundaryWaterLevels = calculationInput.LowerBoundaryWaterLevels.ToNaNAsNull(); + entity.StepSize = Convert.ToByte(calculationInput.StepSize); + entity.CategoryType = Convert.ToByte(calculationInput.CategoryType); + } + + private static void AddEntityForWaveImpactAsphaltCoverWaveConditionsOutput(WaveImpactAsphaltCoverWaveConditionsCalculation calculation, + WaveImpactAsphaltCoverWaveConditionsCalculationEntity entity) + { + if (calculation.HasOutput) + { + var i = 0; + foreach (WaveConditionsOutput waveConditionsOutput in calculation.Output.Items) + { + entity.WaveImpactAsphaltCoverWaveConditionsOutputEntities.Add(waveConditionsOutput.CreateWaveImpactAsphaltCoverWaveConditionsOutputEntity(i++)); + } + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/AssessmentSectionEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/AssessmentSectionEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/AssessmentSectionEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,89 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class AssessmentSectionEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public AssessmentSectionEntity() + { + BackgroundDataEntities = new HashSet(); + FailureMechanismEntities = new HashSet(); + HydraulicBoundaryDatabaseEntities = new HashSet(); + HydraulicLocationEntities = new HashSet(); + } + + public long AssessmentSectionEntityId { get; set; } + public long ProjectEntityId { get; set; } + public long HydraulicLocationCalculationCollectionEntity1Id { get; set; } + public long HydraulicLocationCalculationCollectionEntity2Id { get; set; } + public long HydraulicLocationCalculationCollectionEntity3Id { get; set; } + public long HydraulicLocationCalculationCollectionEntity4Id { get; set; } + public long HydraulicLocationCalculationCollectionEntity5Id { get; set; } + public long HydraulicLocationCalculationCollectionEntity6Id { get; set; } + public long HydraulicLocationCalculationCollectionEntity7Id { get; set; } + public long HydraulicLocationCalculationCollectionEntity8Id { get; set; } + public string Id { get; set; } + public string Name { get; set; } + public string Comments { get; set; } + public double LowerLimitNorm { get; set; } + public double SignalingNorm { get; set; } + public byte NormativeNormType { get; set; } + public byte Composition { get; set; } + public string ReferenceLinePointXml { get; set; } + public int Order { get; set; } + + public virtual ProjectEntity ProjectEntity { get; set; } + public virtual HydraulicLocationCalculationCollectionEntity HydraulicLocationCalculationCollectionEntity { get; set; } + public virtual HydraulicLocationCalculationCollectionEntity HydraulicLocationCalculationCollectionEntity1 { get; set; } + public virtual HydraulicLocationCalculationCollectionEntity HydraulicLocationCalculationCollectionEntity2 { get; set; } + public virtual HydraulicLocationCalculationCollectionEntity HydraulicLocationCalculationCollectionEntity3 { get; set; } + public virtual HydraulicLocationCalculationCollectionEntity HydraulicLocationCalculationCollectionEntity4 { get; set; } + public virtual HydraulicLocationCalculationCollectionEntity HydraulicLocationCalculationCollectionEntity5 { get; set; } + public virtual HydraulicLocationCalculationCollectionEntity HydraulicLocationCalculationCollectionEntity6 { get; set; } + public virtual HydraulicLocationCalculationCollectionEntity HydraulicLocationCalculationCollectionEntity7 { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection BackgroundDataEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection FailureMechanismEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection HydraulicBoundaryDatabaseEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection HydraulicLocationEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/BackgroundDataEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/BackgroundDataEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/BackgroundDataEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,56 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class BackgroundDataEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public BackgroundDataEntity() + { + BackgroundDataMetaEntities = new HashSet(); + } + + public long BackgroundDataEntityId { get; set; } + public long AssessmentSectionEntityId { get; set; } + public string Name { get; set; } + public byte IsVisible { get; set; } + public double Transparency { get; set; } + public byte BackgroundDataType { get; set; } + + public virtual AssessmentSectionEntity AssessmentSectionEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection BackgroundDataMetaEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/BackgroundDataMetaEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/BackgroundDataMetaEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/BackgroundDataMetaEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,42 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class BackgroundDataMetaEntity + { + public long BackgroundDataMetaEntityId { get; set; } + public long BackgroundDataEntityId { get; set; } + public string Key { get; set; } + public string Value { get; set; } + + public virtual BackgroundDataEntity BackgroundDataEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/CalculationGroupEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/CalculationGroupEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/CalculationGroupEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,94 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class CalculationGroupEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public CalculationGroupEntity() + { + CalculationGroupEntity1 = new HashSet(); + ClosingStructuresCalculationEntities = new HashSet(); + FailureMechanismEntities = new HashSet(); + GrassCoverErosionInwardsCalculationEntities = new HashSet(); + GrassCoverErosionOutwardsWaveConditionsCalculationEntities = new HashSet(); + HeightStructuresCalculationEntities = new HashSet(); + MacroStabilityInwardsCalculationEntities = new HashSet(); + PipingCalculationEntities = new HashSet(); + StabilityPointStructuresCalculationEntities = new HashSet(); + StabilityStoneCoverWaveConditionsCalculationEntities = new HashSet(); + WaveImpactAsphaltCoverWaveConditionsCalculationEntities = new HashSet(); + } + + public long CalculationGroupEntityId { get; set; } + public long? ParentCalculationGroupEntityId { get; set; } + public string Name { get; set; } + public int Order { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection CalculationGroupEntity1 { get; set; } + + public virtual CalculationGroupEntity CalculationGroupEntity2 { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection ClosingStructuresCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection FailureMechanismEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionInwardsCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionOutwardsWaveConditionsCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection HeightStructuresCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MacroStabilityInwardsCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection PipingCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StabilityPointStructuresCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StabilityStoneCoverWaveConditionsCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection WaveImpactAsphaltCoverWaveConditionsCalculationEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ClosingStructureEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ClosingStructureEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ClosingStructureEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,81 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class ClosingStructureEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public ClosingStructureEntity() + { + ClosingStructuresCalculationEntities = new HashSet(); + } + + public long ClosingStructureEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public int Order { get; set; } + public string Name { get; set; } + public string Id { get; set; } + public double? X { get; set; } + public double? Y { get; set; } + public double? StructureNormalOrientation { get; set; } + public double? StorageStructureAreaMean { get; set; } + public double? StorageStructureAreaCoefficientOfVariation { get; set; } + public double? AllowedLevelIncreaseStorageMean { get; set; } + public double? AllowedLevelIncreaseStorageStandardDeviation { get; set; } + public double? WidthFlowAperturesMean { get; set; } + public double? WidthFlowAperturesStandardDeviation { get; set; } + public double? LevelCrestStructureNotClosingMean { get; set; } + public double? LevelCrestStructureNotClosingStandardDeviation { get; set; } + public double? InsideWaterLevelMean { get; set; } + public double? InsideWaterLevelStandardDeviation { get; set; } + public double? ThresholdHeightOpenWeirMean { get; set; } + public double? ThresholdHeightOpenWeirStandardDeviation { get; set; } + public double? AreaFlowAperturesMean { get; set; } + public double? AreaFlowAperturesStandardDeviation { get; set; } + public double? CriticalOvertoppingDischargeMean { get; set; } + public double? CriticalOvertoppingDischargeCoefficientOfVariation { get; set; } + public double? FlowWidthAtBottomProtectionMean { get; set; } + public double? FlowWidthAtBottomProtectionStandardDeviation { get; set; } + public double? ProbabilityOpenStructureBeforeFlooding { get; set; } + public double? FailureProbabilityOpenStructure { get; set; } + public int IdenticalApertures { get; set; } + public double? FailureProbabilityReparation { get; set; } + public byte InflowModelType { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection ClosingStructuresCalculationEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ClosingStructuresCalculationEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ClosingStructuresCalculationEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ClosingStructuresCalculationEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,102 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public partial class ClosingStructuresCalculationEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public ClosingStructuresCalculationEntity() + { + ClosingStructuresOutputEntities = new HashSet(); + ClosingStructuresSectionResultEntities = new HashSet(); + } + + public long ClosingStructuresCalculationEntityId { get; set; } + public long CalculationGroupEntityId { get; set; } + public long? ForeshoreProfileEntityId { get; set; } + public long? HydraulicLocationEntityId { get; set; } + public long? ClosingStructureEntityId { get; set; } + public int Order { get; set; } + public string Name { get; set; } + public string Comments { get; set; } + public double? Orientation { get; set; } + public double? LevelCrestStructureNotClosingMean { get; set; } + public double? LevelCrestStructureNotClosingStandardDeviation { get; set; } + public double? InsideWaterLevelMean { get; set; } + public double? InsideWaterLevelStandardDeviation { get; set; } + public double? ThresholdHeightOpenWeirMean { get; set; } + public double? ThresholdHeightOpenWeirStandardDeviation { get; set; } + public double? AreaFlowAperturesMean { get; set; } + public double? AreaFlowAperturesStandardDeviation { get; set; } + public double ProbabilityOpenStructureBeforeFlooding { get; set; } + public double FailureProbabilityOpenStructure { get; set; } + public int IdenticalApertures { get; set; } + public double FailureProbabilityReparation { get; set; } + public byte InflowModelType { get; set; } + public double? DeviationWaveDirection { get; set; } + public double? DrainCoefficientMean { get; set; } + public double? ModelFactorSuperCriticalFlowMean { get; set; } + public double? FactorStormDurationOpenStructure { get; set; } + + public virtual CalculationGroupEntity CalculationGroupEntity { get; set; } + public virtual ClosingStructureEntity ClosingStructureEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection ClosingStructuresOutputEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection ClosingStructuresSectionResultEntities { get; set; } + + public byte UseBreakWater { get; set; } + public byte BreakWaterType { get; set; } + public double? BreakWaterHeight { get; set; } + public byte UseForeshore { get; set; } + public double? StructureNormalOrientation { get; set; } + public double? StorageStructureAreaMean { get; set; } + public double? StorageStructureAreaCoefficientOfVariation { get; set; } + public double? AllowedLevelIncreaseStorageMean { get; set; } + public double? AllowedLevelIncreaseStorageStandardDeviation { get; set; } + public double? WidthFlowAperturesMean { get; set; } + public double? WidthFlowAperturesStandardDeviation { get; set; } + public double? CriticalOvertoppingDischargeMean { get; set; } + public double? CriticalOvertoppingDischargeCoefficientOfVariation { get; set; } + public double? FlowWidthAtBottomProtectionMean { get; set; } + public double? FlowWidthAtBottomProtectionStandardDeviation { get; set; } + public double FailureProbabilityStructureWithErosion { get; set; } + public double? StormDurationMean { get; set; } + public byte ShouldIllustrationPointsBeCalculated { get; set; } + public virtual HydraulicLocationEntity HydraulicLocationEntity { get; set; } + public virtual ForeshoreProfileEntity ForeshoreProfileEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ClosingStructuresFailureMechanismMetaEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ClosingStructuresFailureMechanismMetaEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ClosingStructuresFailureMechanismMetaEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,43 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class ClosingStructuresFailureMechanismMetaEntity + { + public long ClosingStructuresFailureMechanismMetaEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public int N2A { get; set; } + public string ClosingStructureCollectionSourcePath { get; set; } + public string ForeshoreProfileCollectionSourcePath { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ClosingStructuresOutputEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ClosingStructuresOutputEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ClosingStructuresOutputEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,43 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public partial class ClosingStructuresOutputEntity + { + public long ClosingStructuresOutputEntityId { get; set; } + public long ClosingStructuresCalculationEntityId { get; set; } + public long? GeneralResultFaultTreeIllustrationPointEntityId { get; set; } + + public virtual ClosingStructuresCalculationEntity ClosingStructuresCalculationEntity { get; set; } + public virtual GeneralResultFaultTreeIllustrationPointEntity GeneralResultFaultTreeIllustrationPointEntity { get; set; } + public double? Reliability { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ClosingStructuresSectionResultEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ClosingStructuresSectionResultEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ClosingStructuresSectionResultEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,48 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class ClosingStructuresSectionResultEntity + { + public long ClosingStructuresSectionResultEntityId { get; set; } + public long FailureMechanismSectionEntityId { get; set; } + public long? ClosingStructuresCalculationEntityId { get; set; } + public byte SimpleAssessmentResult { get; set; } + public byte DetailedAssessmentResult { get; set; } + public byte TailorMadeAssessmentResult { get; set; } + public double? TailorMadeAssessmentProbability { get; set; } + public byte UseManualAssembly { get; set; } + public double? ManualAssemblyProbability { get; set; } + + public virtual ClosingStructuresCalculationEntity ClosingStructuresCalculationEntity { get; set; } + public virtual FailureMechanismSectionEntity FailureMechanismSectionEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DikeProfileEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DikeProfileEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DikeProfileEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,64 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class DikeProfileEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public DikeProfileEntity() + { + GrassCoverErosionInwardsCalculationEntities = new HashSet(); + } + + public long DikeProfileEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public string Id { get; set; } + public string Name { get; set; } + public double? Orientation { get; set; } + public byte? BreakWaterType { get; set; } + public double? BreakWaterHeight { get; set; } + public string ForeshoreXml { get; set; } + public string DikeGeometryXml { get; set; } + public double? DikeHeight { get; set; } + public double? X { get; set; } + public double? Y { get; set; } + public double? X0 { get; set; } + public int Order { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionInwardsCalculationEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DuneErosionFailureMechanismMetaEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DuneErosionFailureMechanismMetaEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DuneErosionFailureMechanismMetaEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,51 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class DuneErosionFailureMechanismMetaEntity + { + public long DuneErosionFailureMechanismMetaEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public long DuneLocationCalculationCollectionEntity1Id { get; set; } + public long DuneLocationCalculationCollectionEntity2Id { get; set; } + public long DuneLocationCalculationCollectionEntity3Id { get; set; } + public long DuneLocationCalculationCollectionEntity4Id { get; set; } + public long DuneLocationCalculationCollectionEntity5Id { get; set; } + public double N { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + public virtual DuneLocationCalculationCollectionEntity DuneLocationCalculationCollectionEntity { get; set; } + public virtual DuneLocationCalculationCollectionEntity DuneLocationCalculationCollectionEntity1 { get; set; } + public virtual DuneLocationCalculationCollectionEntity DuneLocationCalculationCollectionEntity2 { get; set; } + public virtual DuneLocationCalculationCollectionEntity DuneLocationCalculationCollectionEntity3 { get; set; } + public virtual DuneLocationCalculationCollectionEntity DuneLocationCalculationCollectionEntity4 { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DuneErosionSectionResultEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DuneErosionSectionResultEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DuneErosionSectionResultEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,49 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class DuneErosionSectionResultEntity + { + public long DuneErosionSectionResultEntityId { get; set; } + public long FailureMechanismSectionEntityId { get; set; } + public byte SimpleAssessmentResult { get; set; } + public byte DetailedAssessmentResultForFactorizedSignalingNorm { get; set; } + public byte DetailedAssessmentResultForSignalingNorm { get; set; } + public byte DetailedAssessmentResultForMechanismSpecificLowerLimitNorm { get; set; } + public byte DetailedAssessmentResultForLowerLimitNorm { get; set; } + public byte DetailedAssessmentResultForFactorizedLowerLimitNorm { get; set; } + public byte TailorMadeAssessmentResult { get; set; } + public byte UseManualAssembly { get; set; } + public byte ManualAssemblyCategoryGroup { get; set; } + + public virtual FailureMechanismSectionEntity FailureMechanismSectionEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DuneLocationCalculationCollectionEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DuneLocationCalculationCollectionEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DuneLocationCalculationCollectionEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,69 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class DuneLocationCalculationCollectionEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public DuneLocationCalculationCollectionEntity() + { + DuneErosionFailureMechanismMetaEntities = new HashSet(); + DuneErosionFailureMechanismMetaEntities1 = new HashSet(); + DuneErosionFailureMechanismMetaEntities2 = new HashSet(); + DuneErosionFailureMechanismMetaEntities3 = new HashSet(); + DuneErosionFailureMechanismMetaEntities4 = new HashSet(); + DuneLocationCalculationEntities = new HashSet(); + } + + public long DuneLocationCalculationCollectionEntityId { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection DuneErosionFailureMechanismMetaEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection DuneErosionFailureMechanismMetaEntities1 { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection DuneErosionFailureMechanismMetaEntities2 { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection DuneErosionFailureMechanismMetaEntities3 { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection DuneErosionFailureMechanismMetaEntities4 { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection DuneLocationCalculationEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DuneLocationCalculationEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DuneLocationCalculationEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DuneLocationCalculationEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,54 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class DuneLocationCalculationEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public DuneLocationCalculationEntity() + { + DuneLocationCalculationOutputEntities = new HashSet(); + } + + public long DuneLocationCalculationEntityId { get; set; } + public long? DuneLocationEntityId { get; set; } + public long? DuneLocationCalculationCollectionEntityId { get; set; } + + public virtual DuneLocationCalculationCollectionEntity DuneLocationCalculationCollectionEntity { get; set; } + public virtual DuneLocationEntity DuneLocationEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection DuneLocationCalculationOutputEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DuneLocationCalculationOutputEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DuneLocationCalculationOutputEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DuneLocationCalculationOutputEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,48 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class DuneLocationCalculationOutputEntity + { + public long DuneLocationCalculationOutputEntityId { get; set; } + public long DuneLocationCalculationEntityId { get; set; } + public double? WaterLevel { get; set; } + public double? WaveHeight { get; set; } + public double? WavePeriod { get; set; } + public double? TargetProbability { get; set; } + public double? TargetReliability { get; set; } + public double? CalculatedProbability { get; set; } + public double? CalculatedReliability { get; set; } + public byte CalculationConvergence { get; set; } + + public virtual DuneLocationCalculationEntity DuneLocationCalculationEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DuneLocationEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DuneLocationEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/DuneLocationEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,61 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class DuneLocationEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public DuneLocationEntity() + { + DuneLocationCalculationEntities = new HashSet(); + } + + public long DuneLocationEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public long LocationId { get; set; } + public string Name { get; set; } + public double? LocationX { get; set; } + public double? LocationY { get; set; } + public int CoastalAreaId { get; set; } + public double? Offset { get; set; } + public double? Orientation { get; set; } + public double? D50 { get; set; } + public int Order { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection DuneLocationCalculationEntities { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/FailureMechanismEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/FailureMechanismEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/FailureMechanismEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,140 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class FailureMechanismEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public FailureMechanismEntity() + { + ClosingStructureEntities = new HashSet(); + ClosingStructuresFailureMechanismMetaEntities = new HashSet(); + DikeProfileEntities = new HashSet(); + DuneErosionFailureMechanismMetaEntities = new HashSet(); + DuneLocationEntities = new HashSet(); + FailureMechanismSectionEntities = new HashSet(); + ForeshoreProfileEntities = new HashSet(); + GrassCoverErosionInwardsFailureMechanismMetaEntities = new HashSet(); + GrassCoverErosionOutwardsFailureMechanismMetaEntities = new HashSet(); + HeightStructureEntities = new HashSet(); + HeightStructuresFailureMechanismMetaEntities = new HashSet(); + MacroStabilityInwardsFailureMechanismMetaEntities = new HashSet(); + MacroStabilityOutwardsFailureMechanismMetaEntities = new HashSet(); + PipingFailureMechanismMetaEntities = new HashSet(); + PipingStructureFailureMechanismMetaEntities = new HashSet(); + StabilityPointStructureEntities = new HashSet(); + StabilityPointStructuresFailureMechanismMetaEntities = new HashSet(); + StabilityStoneCoverFailureMechanismMetaEntities = new HashSet(); + StochasticSoilModelEntities = new HashSet(); + SurfaceLineEntities = new HashSet(); + WaveImpactAsphaltCoverFailureMechanismMetaEntities = new HashSet(); + } + + public long FailureMechanismEntityId { get; set; } + public long AssessmentSectionEntityId { get; set; } + public long? CalculationGroupEntityId { get; set; } + public short FailureMechanismType { get; set; } + public byte IsRelevant { get; set; } + public string FailureMechanismSectionCollectionSourcePath { get; set; } + public string InputComments { get; set; } + public string OutputComments { get; set; } + public string NotRelevantComments { get; set; } + + public virtual AssessmentSectionEntity AssessmentSectionEntity { get; set; } + public virtual CalculationGroupEntity CalculationGroupEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection ClosingStructureEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection ClosingStructuresFailureMechanismMetaEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection DikeProfileEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection DuneErosionFailureMechanismMetaEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection DuneLocationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection FailureMechanismSectionEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection ForeshoreProfileEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionInwardsFailureMechanismMetaEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionOutwardsFailureMechanismMetaEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection HeightStructureEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection HeightStructuresFailureMechanismMetaEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MacroStabilityInwardsFailureMechanismMetaEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MacroStabilityOutwardsFailureMechanismMetaEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection PipingFailureMechanismMetaEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection PipingStructureFailureMechanismMetaEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StabilityPointStructureEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StabilityPointStructuresFailureMechanismMetaEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StabilityStoneCoverFailureMechanismMetaEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StochasticSoilModelEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection SurfaceLineEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection WaveImpactAsphaltCoverFailureMechanismMetaEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/FailureMechanismSectionEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/FailureMechanismSectionEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/FailureMechanismSectionEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,122 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class FailureMechanismSectionEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public FailureMechanismSectionEntity() + { + ClosingStructuresSectionResultEntities = new HashSet(); + DuneErosionSectionResultEntities = new HashSet(); + GrassCoverErosionInwardsSectionResultEntities = new HashSet(); + GrassCoverErosionOutwardsSectionResultEntities = new HashSet(); + GrassCoverSlipOffInwardsSectionResultEntities = new HashSet(); + GrassCoverSlipOffOutwardsSectionResultEntities = new HashSet(); + HeightStructuresSectionResultEntities = new HashSet(); + MacroStabilityInwardsSectionResultEntities = new HashSet(); + MacroStabilityOutwardsSectionResultEntities = new HashSet(); + MicrostabilitySectionResultEntities = new HashSet(); + PipingSectionResultEntities = new HashSet(); + PipingStructureSectionResultEntities = new HashSet(); + StabilityPointStructuresSectionResultEntities = new HashSet(); + StabilityStoneCoverSectionResultEntities = new HashSet(); + StrengthStabilityLengthwiseConstructionSectionResultEntities = new HashSet(); + TechnicalInnovationSectionResultEntities = new HashSet(); + WaterPressureAsphaltCoverSectionResultEntities = new HashSet(); + WaveImpactAsphaltCoverSectionResultEntities = new HashSet(); + } + + public long FailureMechanismSectionEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public string Name { get; set; } + public string FailureMechanismSectionPointXml { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection ClosingStructuresSectionResultEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection DuneErosionSectionResultEntities { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionInwardsSectionResultEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionOutwardsSectionResultEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverSlipOffInwardsSectionResultEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverSlipOffOutwardsSectionResultEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection HeightStructuresSectionResultEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MacroStabilityInwardsSectionResultEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MacroStabilityOutwardsSectionResultEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MicrostabilitySectionResultEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection PipingSectionResultEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection PipingStructureSectionResultEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StabilityPointStructuresSectionResultEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StabilityStoneCoverSectionResultEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StrengthStabilityLengthwiseConstructionSectionResultEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection TechnicalInnovationSectionResultEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection WaterPressureAsphaltCoverSectionResultEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection WaveImpactAsphaltCoverSectionResultEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/FailureMechanismType.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/FailureMechanismType.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/FailureMechanismType.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,119 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +namespace Ringtoets.Storage.Core.DbContext +{ + /// + /// The type failure mechanism available in the application. + /// + public enum FailureMechanismType + { + /// + /// Piping - STPH + /// + Piping = 1, + + /// + /// Macrostabiliteit binnenwaarts - STBI + /// + MacroStabilityInwards = 2, + + /// + /// Golfklappen op asfaltbekleding - AGK + /// + WaveImpactOnAsphaltRevetment = 3, + + /// + /// Grasbekleding erosie buitentalud - GEBU + /// + GrassRevetmentErosionOutwards = 4, + + /// + /// Grasbekleding afschuiven buitentalud - GABU + /// + GrassRevetmentSlidingOutwards = 5, + + /// + /// Grasbekleding erosie kruin en binnentalud - GEKB + /// + GrassRevetmentTopErosionAndInwards = 6, + + /// + /// Stabiliteit steenzetting - ZST + /// + StabilityStoneRevetment = 7, + + /// + /// Duinafslag - DA + /// + DuneErosion = 8, + + /// + /// Hoogte kunstwerk - HTKW + /// + StructureHeight = 9, + + /// + /// Betrouwbaarheid sluiting kunstwerk - BSKW + /// + ReliabilityClosingOfStructure = 10, + + /// + /// Piping bij kunstwerk - PKW + /// + PipingAtStructure = 11, + + /// + /// Sterkte en stabiliteit puntconstructies - STKWp + /// + StabilityPointStructures = 12, + + /// + /// Macrostabiliteit buitenwaarts - STBU + /// + MacroStabilityOutwards = 13, + + /// + /// Microstabiliteit - STMI + /// + Microstability = 14, + + /// + /// Wateroverdruk bij asfaltbekleding - AWO + /// + WaterOverpressureAsphaltRevetment = 15, + + /// + /// Grasbekleding afschuiven binnentalud - GABI + /// + GrassRevetmentSlidingInwards = 16, + + /// + /// Sterkte en stabiliteit langsconstructies - STKWl + /// + StrengthAndStabilityParallelConstruction = 17, + + /// + /// Technische innovaties - INN + /// + TechnicalInnovations = 18 + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/FaultTreeIllustrationPointEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/FaultTreeIllustrationPointEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/FaultTreeIllustrationPointEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,68 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class FaultTreeIllustrationPointEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public FaultTreeIllustrationPointEntity() + { + FaultTreeIllustrationPointEntity1 = new HashSet(); + TopLevelFaultTreeIllustrationPointEntities = new HashSet(); + StochastEntities = new HashSet(); + SubMechanismIllustrationPointEntities = new HashSet(); + } + + public long FaultTreeIllustrationPointEntityId { get; set; } + public long? ParentFaultTreeIllustrationPointEntityId { get; set; } + public string Name { get; set; } + public double Beta { get; set; } + public byte CombinationType { get; set; } + public int Order { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection FaultTreeIllustrationPointEntity1 { get; set; } + + public virtual FaultTreeIllustrationPointEntity FaultTreeIllustrationPointEntity2 { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection TopLevelFaultTreeIllustrationPointEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StochastEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection SubMechanismIllustrationPointEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ForeshoreProfileEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ForeshoreProfileEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ForeshoreProfileEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,82 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class ForeshoreProfileEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public ForeshoreProfileEntity() + { + ClosingStructuresCalculationEntities = new HashSet(); + GrassCoverErosionOutwardsWaveConditionsCalculationEntities = new HashSet(); + HeightStructuresCalculationEntities = new HashSet(); + StabilityPointStructuresCalculationEntities = new HashSet(); + StabilityStoneCoverWaveConditionsCalculationEntities = new HashSet(); + WaveImpactAsphaltCoverWaveConditionsCalculationEntities = new HashSet(); + } + + public long ForeshoreProfileEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public string Id { get; set; } + public string Name { get; set; } + public double? Orientation { get; set; } + public byte? BreakWaterType { get; set; } + public double? BreakWaterHeight { get; set; } + public string GeometryXml { get; set; } + public double? X { get; set; } + public double? Y { get; set; } + public double? X0 { get; set; } + public int Order { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection ClosingStructuresCalculationEntities { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionOutwardsWaveConditionsCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection HeightStructuresCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StabilityPointStructuresCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StabilityStoneCoverWaveConditionsCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection WaveImpactAsphaltCoverWaveConditionsCalculationEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GeneralResultFaultTreeIllustrationPointEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GeneralResultFaultTreeIllustrationPointEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GeneralResultFaultTreeIllustrationPointEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,80 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public partial class GeneralResultFaultTreeIllustrationPointEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public GeneralResultFaultTreeIllustrationPointEntity() + { + ClosingStructuresOutputEntities = new HashSet(); + GrassCoverErosionInwardsDikeHeightOutputEntities = new HashSet(); + GrassCoverErosionInwardsOutputEntities = new HashSet(); + GrassCoverErosionInwardsOvertoppingRateOutputEntities = new HashSet(); + HeightStructuresOutputEntities = new HashSet(); + StabilityPointStructuresOutputEntities = new HashSet(); + TopLevelFaultTreeIllustrationPointEntities = new HashSet(); + StochastEntities = new HashSet(); + } + + public long GeneralResultFaultTreeIllustrationPointEntityId { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection ClosingStructuresOutputEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionInwardsDikeHeightOutputEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionInwardsOutputEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionInwardsOvertoppingRateOutputEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection HeightStructuresOutputEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StabilityPointStructuresOutputEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection TopLevelFaultTreeIllustrationPointEntities { get; set; } + + public string GoverningWindDirectionName { get; set; } + public double GoverningWindDirectionAngle { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StochastEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GeneralResultSubMechanismIllustrationPointEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GeneralResultSubMechanismIllustrationPointEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GeneralResultSubMechanismIllustrationPointEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,60 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public partial class GeneralResultSubMechanismIllustrationPointEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public GeneralResultSubMechanismIllustrationPointEntity() + { + HydraulicLocationOutputEntities = new HashSet(); + TopLevelSubMechanismIllustrationPointEntities = new HashSet(); + StochastEntities = new HashSet(); + } + + public long GeneralResultSubMechanismIllustrationPointEntityId { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection HydraulicLocationOutputEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection TopLevelSubMechanismIllustrationPointEntities { get; set; } + + public string GoverningWindDirectionName { get; set; } + public double GoverningWindDirectionAngle { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StochastEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionInwardsCalculationEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionInwardsCalculationEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionInwardsCalculationEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,76 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class GrassCoverErosionInwardsCalculationEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public GrassCoverErosionInwardsCalculationEntity() + { + GrassCoverErosionInwardsOutputEntities = new HashSet(); + GrassCoverErosionInwardsSectionResultEntities = new HashSet(); + } + + public long GrassCoverErosionInwardsCalculationEntityId { get; set; } + public long CalculationGroupEntityId { get; set; } + public long? HydraulicLocationEntityId { get; set; } + public long? DikeProfileEntityId { get; set; } + public int Order { get; set; } + public string Name { get; set; } + public string Comments { get; set; } + public double? Orientation { get; set; } + public double? CriticalFlowRateMean { get; set; } + public double? CriticalFlowRateStandardDeviation { get; set; } + public byte UseForeshore { get; set; } + public byte DikeHeightCalculationType { get; set; } + public double? DikeHeight { get; set; } + public byte UseBreakWater { get; set; } + public byte BreakWaterType { get; set; } + public double? BreakWaterHeight { get; set; } + public byte OvertoppingRateCalculationType { get; set; } + public byte ShouldDikeHeightIllustrationPointsBeCalculated { get; set; } + public byte ShouldOvertoppingRateIllustrationPointsBeCalculated { get; set; } + public byte ShouldOvertoppingOutputIllustrationPointsBeCalculated { get; set; } + + public virtual CalculationGroupEntity CalculationGroupEntity { get; set; } + public virtual DikeProfileEntity DikeProfileEntity { get; set; } + public virtual HydraulicLocationEntity HydraulicLocationEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionInwardsOutputEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionInwardsSectionResultEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionInwardsDikeHeightOutputEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionInwardsDikeHeightOutputEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionInwardsDikeHeightOutputEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,48 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class GrassCoverErosionInwardsDikeHeightOutputEntity + { + public long GrassCoverErosionInwardsDikeHeightOutputEntityId { get; set; } + public long GrassCoverErosionInwardsOutputEntityId { get; set; } + public long? GeneralResultFaultTreeIllustrationPointEntityId { get; set; } + public double? DikeHeight { get; set; } + public double? TargetProbability { get; set; } + public double? TargetReliability { get; set; } + public double? CalculatedProbability { get; set; } + public double? CalculatedReliability { get; set; } + public byte CalculationConvergence { get; set; } + + public virtual GeneralResultFaultTreeIllustrationPointEntity GeneralResultFaultTreeIllustrationPointEntity { get; set; } + public virtual GrassCoverErosionInwardsOutputEntity GrassCoverErosionInwardsOutputEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionInwardsFailureMechanismMetaEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionInwardsFailureMechanismMetaEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionInwardsFailureMechanismMetaEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,42 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class GrassCoverErosionInwardsFailureMechanismMetaEntity + { + public long GrassCoverErosionInwardsFailureMechanismMetaEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public double N { get; set; } + public string DikeProfileCollectionSourcePath { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionInwardsOutputEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionInwardsOutputEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionInwardsOutputEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class GrassCoverErosionInwardsOutputEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public GrassCoverErosionInwardsOutputEntity() + { + GrassCoverErosionInwardsDikeHeightOutputEntities = new HashSet(); + GrassCoverErosionInwardsOvertoppingRateOutputEntities = new HashSet(); + } + + public long GrassCoverErosionInwardsOutputEntityId { get; set; } + public long GrassCoverErosionInwardsCalculationEntityId { get; set; } + public long? GeneralResultFaultTreeIllustrationPointEntityId { get; set; } + public int Order { get; set; } + public byte IsOvertoppingDominant { get; set; } + public double? WaveHeight { get; set; } + public double? Reliability { get; set; } + + public virtual GeneralResultFaultTreeIllustrationPointEntity GeneralResultFaultTreeIllustrationPointEntity { get; set; } + public virtual GrassCoverErosionInwardsCalculationEntity GrassCoverErosionInwardsCalculationEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionInwardsDikeHeightOutputEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionInwardsOvertoppingRateOutputEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionInwardsOvertoppingRateOutputEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionInwardsOvertoppingRateOutputEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionInwardsOvertoppingRateOutputEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,48 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class GrassCoverErosionInwardsOvertoppingRateOutputEntity + { + public long GrassCoverErosionInwardsOvertoppingRateOutputEntityId { get; set; } + public long GrassCoverErosionInwardsOutputEntityId { get; set; } + public long? GeneralResultFaultTreeIllustrationPointEntityId { get; set; } + public double? OvertoppingRate { get; set; } + public double? TargetProbability { get; set; } + public double? TargetReliability { get; set; } + public double? CalculatedProbability { get; set; } + public double? CalculatedReliability { get; set; } + public byte CalculationConvergence { get; set; } + + public virtual GeneralResultFaultTreeIllustrationPointEntity GeneralResultFaultTreeIllustrationPointEntity { get; set; } + public virtual GrassCoverErosionInwardsOutputEntity GrassCoverErosionInwardsOutputEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionInwardsSectionResultEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionInwardsSectionResultEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionInwardsSectionResultEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,48 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class GrassCoverErosionInwardsSectionResultEntity + { + public long GrassCoverErosionInwardsSectionResultEntityId { get; set; } + public long FailureMechanismSectionEntityId { get; set; } + public long? GrassCoverErosionInwardsCalculationEntityId { get; set; } + public byte SimpleAssessmentResult { get; set; } + public byte DetailedAssessmentResult { get; set; } + public byte TailorMadeAssessmentResult { get; set; } + public double? TailorMadeAssessmentProbability { get; set; } + public byte UseManualAssembly { get; set; } + public double? ManualAssemblyProbability { get; set; } + + public virtual FailureMechanismSectionEntity FailureMechanismSectionEntity { get; set; } + public virtual GrassCoverErosionInwardsCalculationEntity GrassCoverErosionInwardsCalculationEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionOutwardsFailureMechanismMetaEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionOutwardsFailureMechanismMetaEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionOutwardsFailureMechanismMetaEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,54 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class GrassCoverErosionOutwardsFailureMechanismMetaEntity + { + public long GrassCoverErosionOutwardsFailureMechanismMetaEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public long HydraulicLocationCalculationCollectionEntity1Id { get; set; } + public long HydraulicLocationCalculationCollectionEntity2Id { get; set; } + public long HydraulicLocationCalculationCollectionEntity3Id { get; set; } + public long HydraulicLocationCalculationCollectionEntity4Id { get; set; } + public long HydraulicLocationCalculationCollectionEntity5Id { get; set; } + public long HydraulicLocationCalculationCollectionEntity6Id { get; set; } + public double N { get; set; } + public string ForeshoreProfileCollectionSourcePath { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + public virtual HydraulicLocationCalculationCollectionEntity HydraulicLocationCalculationCollectionEntity { get; set; } + public virtual HydraulicLocationCalculationCollectionEntity HydraulicLocationCalculationCollectionEntity1 { get; set; } + public virtual HydraulicLocationCalculationCollectionEntity HydraulicLocationCalculationCollectionEntity2 { get; set; } + public virtual HydraulicLocationCalculationCollectionEntity HydraulicLocationCalculationCollectionEntity3 { get; set; } + public virtual HydraulicLocationCalculationCollectionEntity HydraulicLocationCalculationCollectionEntity4 { get; set; } + public virtual HydraulicLocationCalculationCollectionEntity HydraulicLocationCalculationCollectionEntity5 { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionOutwardsSectionResultEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionOutwardsSectionResultEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionOutwardsSectionResultEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,49 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class GrassCoverErosionOutwardsSectionResultEntity + { + public long GrassCoverErosionOutwardsSectionResultEntityId { get; set; } + public long FailureMechanismSectionEntityId { get; set; } + public byte SimpleAssessmentResult { get; set; } + public byte DetailedAssessmentResultForFactorizedSignalingNorm { get; set; } + public byte DetailedAssessmentResultForSignalingNorm { get; set; } + public byte DetailedAssessmentResultForMechanismSpecificLowerLimitNorm { get; set; } + public byte DetailedAssessmentResultForLowerLimitNorm { get; set; } + public byte DetailedAssessmentResultForFactorizedLowerLimitNorm { get; set; } + public byte TailorMadeAssessmentResult { get; set; } + public byte UseManualAssembly { get; set; } + public byte ManualAssemblyCategoryGroup { get; set; } + + public virtual FailureMechanismSectionEntity FailureMechanismSectionEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionOutwardsWaveConditionsCalculationEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionOutwardsWaveConditionsCalculationEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionOutwardsWaveConditionsCalculationEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,70 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class GrassCoverErosionOutwardsWaveConditionsCalculationEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public GrassCoverErosionOutwardsWaveConditionsCalculationEntity() + { + GrassCoverErosionOutwardsWaveConditionsOutputEntities = new HashSet(); + } + + public long GrassCoverErosionOutwardsWaveConditionsCalculationEntityId { get; set; } + public long CalculationGroupEntityId { get; set; } + public long? ForeshoreProfileEntityId { get; set; } + public long? HydraulicLocationEntityId { get; set; } + public int Order { get; set; } + public string Name { get; set; } + public string Comments { get; set; } + public byte UseBreakWater { get; set; } + public byte BreakWaterType { get; set; } + public double? BreakWaterHeight { get; set; } + public byte UseForeshore { get; set; } + public double? Orientation { get; set; } + public double? UpperBoundaryRevetment { get; set; } + public double? LowerBoundaryRevetment { get; set; } + public double? UpperBoundaryWaterLevels { get; set; } + public double? LowerBoundaryWaterLevels { get; set; } + public byte StepSize { get; set; } + public byte CategoryType { get; set; } + + public virtual CalculationGroupEntity CalculationGroupEntity { get; set; } + public virtual ForeshoreProfileEntity ForeshoreProfileEntity { get; set; } + public virtual HydraulicLocationEntity HydraulicLocationEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionOutwardsWaveConditionsOutputEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionOutwardsWaveConditionsOutputEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionOutwardsWaveConditionsOutputEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverErosionOutwardsWaveConditionsOutputEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,51 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class GrassCoverErosionOutwardsWaveConditionsOutputEntity + { + public long GrassCoverErosionOutwardsWaveConditionsOutputEntityId { get; set; } + public long GrassCoverErosionOutwardsWaveConditionsCalculationEntityId { get; set; } + public int Order { get; set; } + public double? WaterLevel { get; set; } + public double? WaveHeight { get; set; } + public double? WavePeakPeriod { get; set; } + public double? WaveAngle { get; set; } + public double? WaveDirection { get; set; } + public double? TargetProbability { get; set; } + public double? TargetReliability { get; set; } + public double? CalculatedProbability { get; set; } + public double? CalculatedReliability { get; set; } + public byte CalculationConvergence { get; set; } + + public virtual GrassCoverErosionOutwardsWaveConditionsCalculationEntity GrassCoverErosionOutwardsWaveConditionsCalculationEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverSlipOffInwardsSectionResultEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverSlipOffInwardsSectionResultEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverSlipOffInwardsSectionResultEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,45 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class GrassCoverSlipOffInwardsSectionResultEntity + { + public long GrassCoverSlipOffInwardsSectionResultEntityId { get; set; } + public long FailureMechanismSectionEntityId { get; set; } + public byte SimpleAssessmentResult { get; set; } + public byte DetailedAssessmentResult { get; set; } + public byte TailorMadeAssessmentResult { get; set; } + public byte UseManualAssembly { get; set; } + public byte ManualAssemblyCategoryGroup { get; set; } + + public virtual FailureMechanismSectionEntity FailureMechanismSectionEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverSlipOffOutwardsSectionResultEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverSlipOffOutwardsSectionResultEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/GrassCoverSlipOffOutwardsSectionResultEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,45 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class GrassCoverSlipOffOutwardsSectionResultEntity + { + public long GrassCoverSlipOffOutwardsSectionResultEntityId { get; set; } + public long FailureMechanismSectionEntityId { get; set; } + public byte SimpleAssessmentResult { get; set; } + public byte DetailedAssessmentResult { get; set; } + public byte TailorMadeAssessmentResult { get; set; } + public byte UseManualAssembly { get; set; } + public byte ManualAssemblyCategoryGroup { get; set; } + + public virtual FailureMechanismSectionEntity FailureMechanismSectionEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HeightStructureEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HeightStructureEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HeightStructureEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,71 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class HeightStructureEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public HeightStructureEntity() + { + HeightStructuresCalculationEntities = new HashSet(); + } + + public long HeightStructureEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public int Order { get; set; } + public string Name { get; set; } + public string Id { get; set; } + public double? X { get; set; } + public double? Y { get; set; } + public double? StructureNormalOrientation { get; set; } + public double? LevelCrestStructureMean { get; set; } + public double? LevelCrestStructureStandardDeviation { get; set; } + public double? FlowWidthAtBottomProtectionMean { get; set; } + public double? FlowWidthAtBottomProtectionStandardDeviation { get; set; } + public double? CriticalOvertoppingDischargeMean { get; set; } + public double? CriticalOvertoppingDischargeCoefficientOfVariation { get; set; } + public double? WidthFlowAperturesMean { get; set; } + public double? WidthFlowAperturesStandardDeviation { get; set; } + public double? FailureProbabilityStructureWithErosion { get; set; } + public double? StorageStructureAreaMean { get; set; } + public double? StorageStructureAreaCoefficientOfVariation { get; set; } + public double? AllowedLevelIncreaseStorageMean { get; set; } + public double? AllowedLevelIncreaseStorageStandardDeviation { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection HeightStructuresCalculationEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HeightStructuresCalculationEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HeightStructuresCalculationEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HeightStructuresCalculationEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,88 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public partial class HeightStructuresCalculationEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public HeightStructuresCalculationEntity() + { + HeightStructuresOutputEntities = new HashSet(); + HeightStructuresSectionResultEntities = new HashSet(); + } + + public long HeightStructuresCalculationEntityId { get; set; } + public long CalculationGroupEntityId { get; set; } + public long? HydraulicLocationEntityId { get; set; } + public long? HeightStructureEntityId { get; set; } + public long? ForeshoreProfileEntityId { get; set; } + public int Order { get; set; } + public string Name { get; set; } + public string Comments { get; set; } + public double? ModelFactorSuperCriticalFlowMean { get; set; } + public double? LevelCrestStructureMean { get; set; } + public double? LevelCrestStructureStandardDeviation { get; set; } + public double? DeviationWaveDirection { get; set; } + + public virtual CalculationGroupEntity CalculationGroupEntity { get; set; } + public virtual HeightStructureEntity HeightStructureEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection HeightStructuresOutputEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection HeightStructuresSectionResultEntities { get; set; } + + public double? StructureNormalOrientation { get; set; } + public double? AllowedLevelIncreaseStorageMean { get; set; } + public double? AllowedLevelIncreaseStorageStandardDeviation { get; set; } + public double? StorageStructureAreaMean { get; set; } + public double? StorageStructureAreaCoefficientOfVariation { get; set; } + public double? FlowWidthAtBottomProtectionMean { get; set; } + public double? FlowWidthAtBottomProtectionStandardDeviation { get; set; } + public double? CriticalOvertoppingDischargeMean { get; set; } + public double? CriticalOvertoppingDischargeCoefficientOfVariation { get; set; } + public double FailureProbabilityStructureWithErosion { get; set; } + public double? WidthFlowAperturesMean { get; set; } + public double? WidthFlowAperturesStandardDeviation { get; set; } + public double? StormDurationMean { get; set; } + public byte UseBreakWater { get; set; } + public byte UseForeshore { get; set; } + public byte BreakWaterType { get; set; } + public double? BreakWaterHeight { get; set; } + public byte ShouldIllustrationPointsBeCalculated { get; set; } + public virtual ForeshoreProfileEntity ForeshoreProfileEntity { get; set; } + public virtual HydraulicLocationEntity HydraulicLocationEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HeightStructuresFailureMechanismMetaEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HeightStructuresFailureMechanismMetaEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HeightStructuresFailureMechanismMetaEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,43 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class HeightStructuresFailureMechanismMetaEntity + { + public long HeightStructuresFailureMechanismMetaEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public double N { get; set; } + public string HeightStructureCollectionSourcePath { get; set; } + public string ForeshoreProfileCollectionSourcePath { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HeightStructuresOutputEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HeightStructuresOutputEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HeightStructuresOutputEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,43 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public partial class HeightStructuresOutputEntity + { + public long HeightStructuresOutputEntityId { get; set; } + public long HeightStructuresCalculationEntityId { get; set; } + public long? GeneralResultFaultTreeIllustrationPointEntityId { get; set; } + public virtual HeightStructuresCalculationEntity HeightStructuresCalculationEntity { get; set; } + + public virtual GeneralResultFaultTreeIllustrationPointEntity GeneralResultFaultTreeIllustrationPointEntity { get; set; } + public double? Reliability { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HeightStructuresSectionResultEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HeightStructuresSectionResultEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HeightStructuresSectionResultEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,48 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class HeightStructuresSectionResultEntity + { + public long HeightStructuresSectionResultEntityId { get; set; } + public long FailureMechanismSectionEntityId { get; set; } + public long? HeightStructuresCalculationEntityId { get; set; } + public byte SimpleAssessmentResult { get; set; } + public byte DetailedAssessmentResult { get; set; } + public byte TailorMadeAssessmentResult { get; set; } + public double? TailorMadeAssessmentProbability { get; set; } + public byte UseManualAssembly { get; set; } + public double? ManualAssemblyProbability { get; set; } + + public virtual FailureMechanismSectionEntity FailureMechanismSectionEntity { get; set; } + public virtual HeightStructuresCalculationEntity HeightStructuresCalculationEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HydraulicBoundaryDatabaseEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HydraulicBoundaryDatabaseEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HydraulicBoundaryDatabaseEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,52 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class HydraulicBoundaryDatabaseEntity + { + public long HydraulicBoundaryDatabaseEntity1 { get; set; } + public long AssessmentSectionEntityId { get; set; } + public string Version { get; set; } + public string FilePath { get; set; } + public string HydraulicLocationConfigurationSettingsFilePath { get; set; } + public string HydraulicLocationConfigurationSettingsScenarioName { get; set; } + public int HydraulicLocationConfigurationSettingsYear { get; set; } + public string HydraulicLocationConfigurationSettingsScope { get; set; } + public string HydraulicLocationConfigurationSettingsSeaLevel { get; set; } + public string HydraulicLocationConfigurationSettingsRiverDischarge { get; set; } + public string HydraulicLocationConfigurationSettingsLakeLevel { get; set; } + public string HydraulicLocationConfigurationSettingsWindDirection { get; set; } + public string HydraulicLocationConfigurationSettingsWindSpeed { get; set; } + public string HydraulicLocationConfigurationSettingsComment { get; set; } + + public virtual AssessmentSectionEntity AssessmentSectionEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HydraulicLocationCalculationCollectionEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HydraulicLocationCalculationCollectionEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HydraulicLocationCalculationCollectionEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,105 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class HydraulicLocationCalculationCollectionEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public HydraulicLocationCalculationCollectionEntity() + { + AssessmentSectionEntities = new HashSet(); + AssessmentSectionEntities1 = new HashSet(); + AssessmentSectionEntities2 = new HashSet(); + AssessmentSectionEntities3 = new HashSet(); + AssessmentSectionEntities4 = new HashSet(); + AssessmentSectionEntities5 = new HashSet(); + AssessmentSectionEntities6 = new HashSet(); + AssessmentSectionEntities7 = new HashSet(); + GrassCoverErosionOutwardsFailureMechanismMetaEntities = new HashSet(); + GrassCoverErosionOutwardsFailureMechanismMetaEntities1 = new HashSet(); + GrassCoverErosionOutwardsFailureMechanismMetaEntities2 = new HashSet(); + GrassCoverErosionOutwardsFailureMechanismMetaEntities3 = new HashSet(); + GrassCoverErosionOutwardsFailureMechanismMetaEntities4 = new HashSet(); + GrassCoverErosionOutwardsFailureMechanismMetaEntities5 = new HashSet(); + HydraulicLocationCalculationEntities = new HashSet(); + } + + public long HydraulicLocationCalculationCollectionEntityId { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection AssessmentSectionEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection AssessmentSectionEntities1 { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection AssessmentSectionEntities2 { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection AssessmentSectionEntities3 { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection AssessmentSectionEntities4 { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection AssessmentSectionEntities5 { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection AssessmentSectionEntities6 { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection AssessmentSectionEntities7 { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionOutwardsFailureMechanismMetaEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionOutwardsFailureMechanismMetaEntities1 { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionOutwardsFailureMechanismMetaEntities2 { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionOutwardsFailureMechanismMetaEntities3 { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionOutwardsFailureMechanismMetaEntities4 { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionOutwardsFailureMechanismMetaEntities5 { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection HydraulicLocationCalculationEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HydraulicLocationCalculationEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HydraulicLocationCalculationEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HydraulicLocationCalculationEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,55 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class HydraulicLocationCalculationEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public HydraulicLocationCalculationEntity() + { + HydraulicLocationOutputEntities = new HashSet(); + } + + public long HydraulicLocationCalculationEntityId { get; set; } + public long HydraulicLocationEntityId { get; set; } + public long HydraulicLocationCalculationCollectionEntityId { get; set; } + public byte ShouldIllustrationPointsBeCalculated { get; set; } + + public virtual HydraulicLocationCalculationCollectionEntity HydraulicLocationCalculationCollectionEntity { get; set; } + public virtual HydraulicLocationEntity HydraulicLocationEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection HydraulicLocationOutputEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HydraulicLocationEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HydraulicLocationEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HydraulicLocationEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,93 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class HydraulicLocationEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public HydraulicLocationEntity() + { + ClosingStructuresCalculationEntities = new HashSet(); + GrassCoverErosionInwardsCalculationEntities = new HashSet(); + GrassCoverErosionOutwardsWaveConditionsCalculationEntities = new HashSet(); + HeightStructuresCalculationEntities = new HashSet(); + HydraulicLocationCalculationEntities = new HashSet(); + MacroStabilityInwardsCalculationEntities = new HashSet(); + PipingCalculationEntities = new HashSet(); + StabilityPointStructuresCalculationEntities = new HashSet(); + StabilityStoneCoverWaveConditionsCalculationEntities = new HashSet(); + WaveImpactAsphaltCoverWaveConditionsCalculationEntities = new HashSet(); + } + + public long HydraulicLocationEntityId { get; set; } + public long AssessmentSectionEntityId { get; set; } + public long LocationId { get; set; } + public string Name { get; set; } + public double? LocationX { get; set; } + public double? LocationY { get; set; } + public int Order { get; set; } + + public virtual AssessmentSectionEntity AssessmentSectionEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection ClosingStructuresCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionInwardsCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GrassCoverErosionOutwardsWaveConditionsCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection HeightStructuresCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection HydraulicLocationCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MacroStabilityInwardsCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection PipingCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StabilityPointStructuresCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StabilityStoneCoverWaveConditionsCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection WaveImpactAsphaltCoverWaveConditionsCalculationEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HydraulicLocationOutputEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HydraulicLocationOutputEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HydraulicLocationOutputEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,48 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class HydraulicLocationOutputEntity + { + public long HydraulicLocationOutputEntityId { get; set; } + public long? HydraulicLocationCalculationEntityId { get; set; } + public long? GeneralResultSubMechanismIllustrationPointEntityId { get; set; } + public double? Result { get; set; } + public double? TargetProbability { get; set; } + public double? TargetReliability { get; set; } + public double? CalculatedProbability { get; set; } + public double? CalculatedReliability { get; set; } + public byte CalculationConvergence { get; set; } + + public virtual GeneralResultSubMechanismIllustrationPointEntity GeneralResultSubMechanismIllustrationPointEntity { get; set; } + public virtual HydraulicLocationCalculationEntity HydraulicLocationCalculationEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HydraulicLocationOutputType.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HydraulicLocationOutputType.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/HydraulicLocationOutputType.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,39 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +namespace Ringtoets.Storage.Core.DbContext +{ + /// + /// The hydraulic boundary location calculations in the application. + /// + public enum HydraulicLocationOutputType + { + /// + /// Output of a design water level calculation. + /// + DesignWaterLevel = 1, + + /// + /// Output of a wave height calculation. + /// + WaveHeight = 2 + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/IGeneralResultEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/IGeneralResultEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/IGeneralResultEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,46 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Collections.Generic; + +namespace Ringtoets.Storage.Core.DbContext +{ + /// + /// Interface for a general result entity. + /// + public interface IGeneralResultEntity + { + /// + /// Gets or sets the name of the governing wind direction. + /// + string GoverningWindDirectionName { get; set; } + + /// + /// Gets or sets the angle of the governing wind direction. + /// + double GoverningWindDirectionAngle { get; set; } + + /// + /// Gets the general alpha values. + /// + ICollection StochastEntities { get; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/IHasGeneralResultFaultTreeIllustrationPointEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/IHasGeneralResultFaultTreeIllustrationPointEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/IHasGeneralResultFaultTreeIllustrationPointEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,34 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +namespace Ringtoets.Storage.Core.DbContext +{ + /// + /// Interface for an entity that contains a general result fault tree illustration point. + /// + public interface IHasGeneralResultFaultTreeIllustrationPointEntity + { + /// + /// Gets or sets the general result fault tree illustration point. + /// + GeneralResultFaultTreeIllustrationPointEntity GeneralResultFaultTreeIllustrationPointEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/IStructuresCalculationEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/IStructuresCalculationEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/IStructuresCalculationEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,51 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +namespace Ringtoets.Storage.Core.DbContext +{ + /// + /// Interface for a calculation entity that represents a structure calculation. + /// + public interface IStructuresCalculationEntity + { + double? StructureNormalOrientation { get; set; } + double? AllowedLevelIncreaseStorageMean { get; set; } + double? AllowedLevelIncreaseStorageStandardDeviation { get; set; } + double? StorageStructureAreaMean { get; set; } + double? StorageStructureAreaCoefficientOfVariation { get; set; } + double? FlowWidthAtBottomProtectionMean { get; set; } + double? FlowWidthAtBottomProtectionStandardDeviation { get; set; } + double? CriticalOvertoppingDischargeMean { get; set; } + double? CriticalOvertoppingDischargeCoefficientOfVariation { get; set; } + double FailureProbabilityStructureWithErosion { get; set; } + double? WidthFlowAperturesMean { get; set; } + double? WidthFlowAperturesStandardDeviation { get; set; } + double? StormDurationMean { get; set; } + byte UseBreakWater { get; set; } + byte UseForeshore { get; set; } + byte BreakWaterType { get; set; } + double? BreakWaterHeight { get; set; } + byte ShouldIllustrationPointsBeCalculated { get; set; } + + HydraulicLocationEntity HydraulicLocationEntity { get; set; } + ForeshoreProfileEntity ForeshoreProfileEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/IStructuresOutputEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/IStructuresOutputEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/IStructuresOutputEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,34 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +namespace Ringtoets.Storage.Core.DbContext +{ + /// + /// Interface for an output entity that represents structures output. + /// + public interface IStructuresOutputEntity + { + /// + /// Gets or sets the reliability of the failure mechanism. + /// + double? Reliability { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/IllustrationPointResultEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/IllustrationPointResultEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/IllustrationPointResultEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,43 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class IllustrationPointResultEntity + { + public long IllustrationPointResultEntityId { get; set; } + public long SubMechanismIllustrationPointEntityId { get; set; } + public string Description { get; set; } + public double Value { get; set; } + public int Order { get; set; } + + public virtual SubMechanismIllustrationPointEntity SubMechanismIllustrationPointEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsCalculationEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsCalculationEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsCalculationEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,117 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class MacroStabilityInwardsCalculationEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public MacroStabilityInwardsCalculationEntity() + { + MacroStabilityInwardsCalculationOutputEntities = new HashSet(); + } + + public long MacroStabilityInwardsCalculationEntityId { get; set; } + public long CalculationGroupEntityId { get; set; } + public long? SurfaceLineEntityId { get; set; } + public long? MacroStabilityInwardsStochasticSoilProfileEntityId { get; set; } + public long? HydraulicLocationEntityId { get; set; } + public int Order { get; set; } + public string Name { get; set; } + public string Comment { get; set; } + public byte RelevantForScenario { get; set; } + public double? ScenarioContribution { get; set; } + public double? AssessmentLevel { get; set; } + public byte UseAssessmentLevelManualInput { get; set; } + public double? SlipPlaneMinimumDepth { get; set; } + public double? SlipPlaneMinimumLength { get; set; } + public double? MaximumSliceWidth { get; set; } + public byte MoveGrid { get; set; } + public byte GridDeterminationType { get; set; } + public byte TangentLineDeterminationType { get; set; } + public double? TangentLineZTop { get; set; } + public double? TangentLineZBottom { get; set; } + public int TangentLineNumber { get; set; } + public double? LeftGridXLeft { get; set; } + public double? LeftGridXRight { get; set; } + public int LeftGridNrOfHorizontalPoints { get; set; } + public double? LeftGridZTop { get; set; } + public double? LeftGridZBottom { get; set; } + public int LeftGridNrOfVerticalPoints { get; set; } + public double? RightGridXLeft { get; set; } + public double? RightGridXRight { get; set; } + public int RightGridNrOfHorizontalPoints { get; set; } + public double? RightGridZTop { get; set; } + public double? RightGridZBottom { get; set; } + public int RightGridNrOfVerticalPoints { get; set; } + public byte DikeSoilScenario { get; set; } + public double? WaterLevelRiverAverage { get; set; } + public byte DrainageConstructionPresent { get; set; } + public double? DrainageConstructionCoordinateX { get; set; } + public double? DrainageConstructionCoordinateZ { get; set; } + public double? MinimumLevelPhreaticLineAtDikeTopRiver { get; set; } + public double? MinimumLevelPhreaticLineAtDikeTopPolder { get; set; } + public byte AdjustPhreaticLine3And4ForUplift { get; set; } + public double? LeakageLengthOutwardsPhreaticLine3 { get; set; } + public double? LeakageLengthInwardsPhreaticLine3 { get; set; } + public double? LeakageLengthOutwardsPhreaticLine4 { get; set; } + public double? LeakageLengthInwardsPhreaticLine4 { get; set; } + public double? PiezometricHeadPhreaticLine2Outwards { get; set; } + public double? PiezometricHeadPhreaticLine2Inwards { get; set; } + public double? LocationInputExtremeWaterLevelPolder { get; set; } + public byte LocationInputExtremeUseDefaultOffsets { get; set; } + public double? LocationInputExtremePhreaticLineOffsetBelowDikeTopAtRiver { get; set; } + public double? LocationInputExtremePhreaticLineOffsetBelowDikeTopAtPolder { get; set; } + public double? LocationInputExtremePhreaticLineOffsetBelowShoulderBaseInside { get; set; } + public double? LocationInputExtremePhreaticLineOffsetDikeToeAtPolder { get; set; } + public double? LocationInputExtremePenetrationLength { get; set; } + public double? LocationInputDailyWaterLevelPolder { get; set; } + public byte LocationInputDailyUseDefaultOffsets { get; set; } + public double? LocationInputDailyPhreaticLineOffsetBelowDikeTopAtRiver { get; set; } + public double? LocationInputDailyPhreaticLineOffsetBelowDikeTopAtPolder { get; set; } + public double? LocationInputDailyPhreaticLineOffsetBelowShoulderBaseInside { get; set; } + public double? LocationInputDailyPhreaticLineOffsetDikeToeAtPolder { get; set; } + public byte CreateZones { get; set; } + public byte ZoningBoundariesDeterminationType { get; set; } + public double? ZoneBoundaryLeft { get; set; } + public double? ZoneBoundaryRight { get; set; } + + public virtual CalculationGroupEntity CalculationGroupEntity { get; set; } + public virtual HydraulicLocationEntity HydraulicLocationEntity { get; set; } + public virtual SurfaceLineEntity SurfaceLineEntity { get; set; } + public virtual MacroStabilityInwardsStochasticSoilProfileEntity MacroStabilityInwardsStochasticSoilProfileEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MacroStabilityInwardsCalculationOutputEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsCalculationOutputEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsCalculationOutputEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsCalculationOutputEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,76 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class MacroStabilityInwardsCalculationOutputEntity + { + public long MacroStabilityInwardsCalculationOutputEntityId { get; set; } + public long MacroStabilityInwardsCalculationEntityId { get; set; } + public double? FactorOfStability { get; set; } + public double? ZValue { get; set; } + public double? ForbiddenZonesXEntryMin { get; set; } + public double? ForbiddenZonesXEntryMax { get; set; } + public double? SlidingCurveLeftSlidingCircleCenterX { get; set; } + public double? SlidingCurveLeftSlidingCircleCenterY { get; set; } + public double? SlidingCurveLeftSlidingCircleRadius { get; set; } + public byte SlidingCurveLeftSlidingCircleIsActive { get; set; } + public double? SlidingCurveLeftSlidingCircleNonIteratedForce { get; set; } + public double? SlidingCurveLeftSlidingCircleIteratedForce { get; set; } + public double? SlidingCurveLeftSlidingCircleDrivingMoment { get; set; } + public double? SlidingCurveLeftSlidingCircleResistingMoment { get; set; } + public double? SlidingCurveRightSlidingCircleCenterX { get; set; } + public double? SlidingCurveRightSlidingCircleCenterY { get; set; } + public double? SlidingCurveRightSlidingCircleRadius { get; set; } + public byte SlidingCurveRightSlidingCircleIsActive { get; set; } + public double? SlidingCurveRightSlidingCircleNonIteratedForce { get; set; } + public double? SlidingCurveRightSlidingCircleIteratedForce { get; set; } + public double? SlidingCurveRightSlidingCircleDrivingMoment { get; set; } + public double? SlidingCurveRightSlidingCircleResistingMoment { get; set; } + public double? SlidingCurveNonIteratedHorizontalForce { get; set; } + public double? SlidingCurveIteratedHorizontalForce { get; set; } + public string SlidingCurveSliceXML { get; set; } + public double? SlipPlaneLeftGridXLeft { get; set; } + public double? SlipPlaneLeftGridXRight { get; set; } + public int SlipPlaneLeftGridNrOfHorizontalPoints { get; set; } + public double? SlipPlaneLeftGridZTop { get; set; } + public double? SlipPlaneLeftGridZBottom { get; set; } + public int SlipPlaneLeftGridNrOfVerticalPoints { get; set; } + public double? SlipPlaneRightGridXLeft { get; set; } + public double? SlipPlaneRightGridXRight { get; set; } + public int SlipPlaneRightGridNrOfHorizontalPoints { get; set; } + public double? SlipPlaneRightGridZTop { get; set; } + public double? SlipPlaneRightGridZBottom { get; set; } + public int SlipPlaneRightGridNrOfVerticalPoints { get; set; } + public string SlipPlaneTangentLinesXml { get; set; } + + public virtual MacroStabilityInwardsCalculationEntity MacroStabilityInwardsCalculationEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsCharacteristicPointEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsCharacteristicPointEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsCharacteristicPointEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,44 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class MacroStabilityInwardsCharacteristicPointEntity + { + public long MacroStabilityInwardsCharacteristicPointEntityId { get; set; } + public long SurfaceLineEntityId { get; set; } + public short Type { get; set; } + public double? X { get; set; } + public double? Y { get; set; } + public double? Z { get; set; } + + public virtual SurfaceLineEntity SurfaceLineEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsCharacteristicPointType.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsCharacteristicPointType.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsCharacteristicPointType.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,93 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using Core.Common.Base.Geometry; +using Ringtoets.MacroStabilityInwards.Primitives; + +namespace Ringtoets.Storage.Core.DbContext +{ + /// + /// Denotes a as being used to mark a particular + /// characteristic point of a . + /// + public enum MacroStabilityInwardsCharacteristicPointType + { + /// + /// Corresponds to . + /// + SurfaceLevelOutside = 1, + + /// + /// Corresponds to . + /// + DikeTopAtRiver = 2, + + /// + /// Corresponds to . + /// + DikeToeAtRiver = 3, + + /// + /// Corresponds to . + /// + DikeTopAtPolder = 4, + + /// + /// Corresponds to . + /// + ShoulderBaseInside = 5, + + /// + /// Corresponds to . + /// + ShoulderTopInside = 6, + + /// + /// Corresponds to . + /// + DikeToeAtPolder = 7, + + /// + /// Corresponds to . + /// + DitchDikeSide = 8, + + /// + /// Corresponds to . + /// + BottomDitchDikeSide = 9, + + /// + /// Corresponds to . + /// + BottomDitchPolderSide = 10, + + /// + /// Corresponds to . + /// + DitchPolderSide = 11, + + /// + /// Corresponds to . + /// + SurfaceLevelInside = 12 + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsFailureMechanismMetaEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsFailureMechanismMetaEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsFailureMechanismMetaEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,43 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class MacroStabilityInwardsFailureMechanismMetaEntity + { + public long MacroStabilityInwardsFailureMechanismMetaEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public double A { get; set; } + public string StochasticSoilModelCollectionSourcePath { get; set; } + public string SurfaceLineCollectionSourcePath { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsPreconsolidationStressEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsPreconsolidationStressEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsPreconsolidationStressEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,45 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class MacroStabilityInwardsPreconsolidationStressEntity + { + public long MacroStabilityInwardsPreconsolidationStressEntityId { get; set; } + public long MacroStabilityInwardsSoilProfileTwoDEntityId { get; set; } + public double CoordinateX { get; set; } + public double CoordinateZ { get; set; } + public double? PreconsolidationStressMean { get; set; } + public double? PreconsolidationStressCoefficientOfVariation { get; set; } + public int Order { get; set; } + + public virtual MacroStabilityInwardsSoilProfileTwoDEntity MacroStabilityInwardsSoilProfileTwoDEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsSectionResultEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsSectionResultEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsSectionResultEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,46 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class MacroStabilityInwardsSectionResultEntity + { + public long MacroStabilityInwardsSectionResultEntityId { get; set; } + public long FailureMechanismSectionEntityId { get; set; } + public byte SimpleAssessmentResult { get; set; } + public byte DetailedAssessmentResult { get; set; } + public byte TailorMadeAssessmentResult { get; set; } + public double? TailorMadeAssessmentProbability { get; set; } + public byte UseManualAssembly { get; set; } + public double? ManualAssemblyProbability { get; set; } + + public virtual FailureMechanismSectionEntity FailureMechanismSectionEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsSoilLayerOneDEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsSoilLayerOneDEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsSoilLayerOneDEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,63 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class MacroStabilityInwardsSoilLayerOneDEntity + { + public long MacroStabilityInwardsSoilLayerOneDEntityId { get; set; } + public long MacroStabilityInwardsSoilProfileOneDEntityId { get; set; } + public double? Top { get; set; } + public byte IsAquifer { get; set; } + public long? Color { get; set; } + public string MaterialName { get; set; } + public byte ShearStrengthModel { get; set; } + public byte UsePop { get; set; } + public double? AbovePhreaticLevelMean { get; set; } + public double? AbovePhreaticLevelCoefficientOfVariation { get; set; } + public double? AbovePhreaticLevelShift { get; set; } + public double? BelowPhreaticLevelMean { get; set; } + public double? BelowPhreaticLevelCoefficientOfVariation { get; set; } + public double? BelowPhreaticLevelShift { get; set; } + public double? CohesionMean { get; set; } + public double? CohesionCoefficientOfVariation { get; set; } + public double? FrictionAngleMean { get; set; } + public double? FrictionAngleCoefficientOfVariation { get; set; } + public double? ShearStrengthRatioMean { get; set; } + public double? ShearStrengthRatioCoefficientOfVariation { get; set; } + public double? StrengthIncreaseExponentMean { get; set; } + public double? StrengthIncreaseExponentCoefficientOfVariation { get; set; } + public double? PopMean { get; set; } + public double? PopCoefficientOfVariation { get; set; } + public int Order { get; set; } + + public virtual MacroStabilityInwardsSoilProfileOneDEntity MacroStabilityInwardsSoilProfileOneDEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsSoilLayerTwoDEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsSoilLayerTwoDEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsSoilLayerTwoDEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,79 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class MacroStabilityInwardsSoilLayerTwoDEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public MacroStabilityInwardsSoilLayerTwoDEntity() + { + MacroStabilityInwardsSoilLayerTwoDEntity1 = new HashSet(); + MacroStabilityInwardsSoilProfileTwoDEntities = new HashSet(); + } + + public long MacroStabilityInwardsSoilLayerTwoDEntityId { get; set; } + public long? ParentMacroStabilityInwardsSoilLayerTwoDEntityId { get; set; } + public byte IsAquifer { get; set; } + public long? Color { get; set; } + public string MaterialName { get; set; } + public byte ShearStrengthModel { get; set; } + public byte UsePop { get; set; } + public double? AbovePhreaticLevelMean { get; set; } + public double? AbovePhreaticLevelCoefficientOfVariation { get; set; } + public double? AbovePhreaticLevelShift { get; set; } + public double? BelowPhreaticLevelMean { get; set; } + public double? BelowPhreaticLevelCoefficientOfVariation { get; set; } + public double? BelowPhreaticLevelShift { get; set; } + public double? CohesionMean { get; set; } + public double? CohesionCoefficientOfVariation { get; set; } + public double? FrictionAngleMean { get; set; } + public double? FrictionAngleCoefficientOfVariation { get; set; } + public double? ShearStrengthRatioMean { get; set; } + public double? ShearStrengthRatioCoefficientOfVariation { get; set; } + public double? StrengthIncreaseExponentMean { get; set; } + public double? StrengthIncreaseExponentCoefficientOfVariation { get; set; } + public double? PopMean { get; set; } + public double? PopCoefficientOfVariation { get; set; } + public string OuterRingXml { get; set; } + public int Order { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MacroStabilityInwardsSoilLayerTwoDEntity1 { get; set; } + + public virtual MacroStabilityInwardsSoilLayerTwoDEntity MacroStabilityInwardsSoilLayerTwoDEntity2 { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MacroStabilityInwardsSoilProfileTwoDEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsSoilProfileOneDEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsSoilProfileOneDEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsSoilProfileOneDEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,55 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class MacroStabilityInwardsSoilProfileOneDEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public MacroStabilityInwardsSoilProfileOneDEntity() + { + MacroStabilityInwardsSoilLayerOneDEntities = new HashSet(); + MacroStabilityInwardsStochasticSoilProfileEntities = new HashSet(); + } + + public long MacroStabilityInwardsSoilProfileOneDEntityId { get; set; } + public string Name { get; set; } + public double? Bottom { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MacroStabilityInwardsSoilLayerOneDEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MacroStabilityInwardsStochasticSoilProfileEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsSoilProfileTwoDEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsSoilProfileTwoDEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsSoilProfileTwoDEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,58 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class MacroStabilityInwardsSoilProfileTwoDEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public MacroStabilityInwardsSoilProfileTwoDEntity() + { + MacroStabilityInwardsPreconsolidationStressEntities = new HashSet(); + MacroStabilityInwardsStochasticSoilProfileEntities = new HashSet(); + MacroStabilityInwardsSoilLayerTwoDEntities = new HashSet(); + } + + public long MacroStabilityInwardsSoilProfileTwoDEntityId { get; set; } + public string Name { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MacroStabilityInwardsPreconsolidationStressEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MacroStabilityInwardsStochasticSoilProfileEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MacroStabilityInwardsSoilLayerTwoDEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsStochasticSoilProfileEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsStochasticSoilProfileEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityInwardsStochasticSoilProfileEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,58 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class MacroStabilityInwardsStochasticSoilProfileEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public MacroStabilityInwardsStochasticSoilProfileEntity() + { + MacroStabilityInwardsCalculationEntities = new HashSet(); + } + + public long MacroStabilityInwardsStochasticSoilProfileEntityId { get; set; } + public long StochasticSoilModelEntityId { get; set; } + public long? MacroStabilityInwardsSoilProfileOneDEntityId { get; set; } + public long? MacroStabilityInwardsSoilProfileTwoDEntityId { get; set; } + public double Probability { get; set; } + public int Order { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MacroStabilityInwardsCalculationEntities { get; set; } + + public virtual MacroStabilityInwardsSoilProfileOneDEntity MacroStabilityInwardsSoilProfileOneDEntity { get; set; } + public virtual MacroStabilityInwardsSoilProfileTwoDEntity MacroStabilityInwardsSoilProfileTwoDEntity { get; set; } + public virtual StochasticSoilModelEntity StochasticSoilModelEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityOutwardsFailureMechanismMetaEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityOutwardsFailureMechanismMetaEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityOutwardsFailureMechanismMetaEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,41 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class MacroStabilityOutwardsFailureMechanismMetaEntity + { + public long MacroStabilityOutwardsFailureMechanismMetaEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public double A { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityOutwardsSectionResultEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityOutwardsSectionResultEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MacroStabilityOutwardsSectionResultEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,47 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class MacroStabilityOutwardsSectionResultEntity + { + public long MacroStabilityOutwardsSectionResultEntityId { get; set; } + public long FailureMechanismSectionEntityId { get; set; } + public byte SimpleAssessmentResult { get; set; } + public byte DetailedAssessmentResult { get; set; } + public double? DetailedAssessmentProbability { get; set; } + public byte TailorMadeAssessmentResult { get; set; } + public double? TailorMadeAssessmentProbability { get; set; } + public byte UseManualAssembly { get; set; } + public byte ManualAssemblyCategoryGroup { get; set; } + + public virtual FailureMechanismSectionEntity FailureMechanismSectionEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MicrostabilitySectionResultEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MicrostabilitySectionResultEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/MicrostabilitySectionResultEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,45 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class MicrostabilitySectionResultEntity + { + public long MicrostabilitySectionResultEntityId { get; set; } + public long FailureMechanismSectionEntityId { get; set; } + public byte SimpleAssessmentResult { get; set; } + public byte DetailedAssessmentResult { get; set; } + public byte TailorMadeAssessmentResult { get; set; } + public byte UseManualAssembly { get; set; } + public byte ManualAssemblyCategoryGroup { get; set; } + + public virtual FailureMechanismSectionEntity FailureMechanismSectionEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialClosingStructuresCalculationEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialClosingStructuresCalculationEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialClosingStructuresCalculationEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,29 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +namespace Ringtoets.Storage.Core.DbContext +{ + /// + /// Partial implementation of that implements + /// . + /// + public partial class ClosingStructuresCalculationEntity : IStructuresCalculationEntity {} +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialClosingStructuresOutputEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialClosingStructuresOutputEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialClosingStructuresOutputEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,30 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +namespace Ringtoets.Storage.Core.DbContext +{ + /// + /// Partial implementation of that implements + /// and . + /// + public partial class ClosingStructuresOutputEntity : IStructuresOutputEntity, + IHasGeneralResultFaultTreeIllustrationPointEntity {} +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialGeneralResultFaultTreeIllustrationPointEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialGeneralResultFaultTreeIllustrationPointEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialGeneralResultFaultTreeIllustrationPointEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,29 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +namespace Ringtoets.Storage.Core.DbContext +{ + /// + /// Partial implementation of + /// that implements . + /// + public partial class GeneralResultFaultTreeIllustrationPointEntity : IGeneralResultEntity {} +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialGeneralResultSubMechanismIllustrationPointEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialGeneralResultSubMechanismIllustrationPointEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialGeneralResultSubMechanismIllustrationPointEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,29 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +namespace Ringtoets.Storage.Core.DbContext +{ + /// + /// Partial implementation of + /// that implements . + /// + public partial class GeneralResultSubMechanismIllustrationPointEntity : IGeneralResultEntity {} +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialHeightStructuresCalculationEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialHeightStructuresCalculationEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialHeightStructuresCalculationEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,29 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +namespace Ringtoets.Storage.Core.DbContext +{ + /// + /// Partial implementation of that implements + /// . + /// + public partial class HeightStructuresCalculationEntity : IStructuresCalculationEntity {} +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialHeightStructuresOutputEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialHeightStructuresOutputEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialHeightStructuresOutputEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,30 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +namespace Ringtoets.Storage.Core.DbContext +{ + /// + /// Partial implementation of that implements + /// and . + /// + public partial class HeightStructuresOutputEntity : IStructuresOutputEntity, + IHasGeneralResultFaultTreeIllustrationPointEntity {} +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialRiskeerEntities.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialRiskeerEntities.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialRiskeerEntities.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,154 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Data.Entity; + +namespace Ringtoets.Storage.Core.DbContext +{ + /// + /// Partial implementation of that support a connection string + /// and does not read the connection string from the configuration. + /// + public partial class RiskeerEntities + { + /// + /// A new instance of . + /// + /// A connection string. + public RiskeerEntities(string connString) : base(connString) + { + Configuration.LazyLoadingEnabled = false; + } + + /// + /// Loads all tables into the context. + /// + public void LoadTablesIntoContext() + { + AssessmentSectionEntities.Load(); + BackgroundDataEntities.Load(); + BackgroundDataMetaEntities.Load(); + CalculationGroupEntities.Load(); + ClosingStructureEntities.Load(); + ClosingStructuresCalculationEntities.Load(); + ClosingStructuresFailureMechanismMetaEntities.Load(); + ClosingStructuresOutputEntities.Load(); + ClosingStructuresSectionResultEntities.Load(); + DikeProfileEntities.Load(); + DuneErosionFailureMechanismMetaEntities.Load(); + DuneErosionSectionResultEntities.Load(); + DuneLocationEntities.Load(); + DuneLocationCalculationCollectionEntities.Include(e => e.DuneLocationCalculationEntities) + .Load(); + DuneLocationCalculationEntities.Load(); + DuneLocationCalculationOutputEntities.Load(); + FailureMechanismEntities.Load(); + FailureMechanismSectionEntities.Load(); + ForeshoreProfileEntities.Load(); + GrassCoverErosionInwardsCalculationEntities.Load(); + GrassCoverErosionInwardsDikeHeightOutputEntities.Load(); + GrassCoverErosionInwardsFailureMechanismMetaEntities.Load(); + GrassCoverErosionInwardsOutputEntities.Load(); + GrassCoverErosionInwardsOvertoppingRateOutputEntities.Load(); + GrassCoverErosionInwardsSectionResultEntities.Load(); + GrassCoverErosionOutwardsFailureMechanismMetaEntities.Load(); + GrassCoverErosionOutwardsSectionResultEntities.Load(); + GrassCoverErosionOutwardsWaveConditionsCalculationEntities.Load(); + GrassCoverErosionOutwardsWaveConditionsOutputEntities.Load(); + GrassCoverSlipOffInwardsSectionResultEntities.Load(); + GrassCoverSlipOffOutwardsSectionResultEntities.Load(); + HeightStructureEntities.Load(); + HeightStructuresCalculationEntities.Load(); + HeightStructuresFailureMechanismMetaEntities.Load(); + HeightStructuresOutputEntities.Load(); + HeightStructuresSectionResultEntities.Load(); + HydraulicBoundaryDatabaseEntities.Load(); + HydraulicLocationEntities.Load(); + HydraulicLocationCalculationCollectionEntities.Include(e => e.HydraulicLocationCalculationEntities) + .Load(); + HydraulicLocationCalculationEntities.Load(); + HydraulicLocationOutputEntities.Load(); + MacroStabilityInwardsCharacteristicPointEntities.Load(); + MacroStabilityInwardsSectionResultEntities.Load(); + MacroStabilityInwardsFailureMechanismMetaEntities.Load(); + MacroStabilityInwardsSoilProfileOneDEntities.Load(); + MacroStabilityInwardsSoilLayerOneDEntities.Load(); + MacroStabilityInwardsSoilProfileTwoDEntities.Include(e => e.MacroStabilityInwardsSoilLayerTwoDEntities) + .Load(); + MacroStabilityInwardsSoilLayerTwoDEntities.Load(); + MacroStabilityInwardsStochasticSoilProfileEntities.Load(); + MacroStabilityInwardsPreconsolidationStressEntities.Load(); + MacroStabilityInwardsCalculationEntities.Load(); + MacroStabilityInwardsCalculationOutputEntities.Load(); + MacroStabilityOutwardsSectionResultEntities.Load(); + MacroStabilityOutwardsFailureMechanismMetaEntities.Load(); + MicrostabilitySectionResultEntities.Load(); + ProjectEntities.Load(); + PipingCalculationEntities.Load(); + PipingCalculationOutputEntities.Load(); + PipingCharacteristicPointEntities.Load(); + PipingFailureMechanismMetaEntities.Load(); + PipingSectionResultEntities.Load(); + PipingSoilLayerEntities.Load(); + PipingSoilProfileEntities.Load(); + PipingStructureFailureMechanismMetaEntities.Load(); + PipingStructureSectionResultEntities.Load(); + PipingStochasticSoilProfileEntities.Load(); + StabilityPointStructureEntities.Load(); + StabilityPointStructuresCalculationEntities.Load(); + StabilityPointStructuresFailureMechanismMetaEntities.Load(); + StabilityPointStructuresOutputEntities.Load(); + StabilityPointStructuresSectionResultEntities.Load(); + StabilityStoneCoverFailureMechanismMetaEntities.Load(); + StabilityStoneCoverSectionResultEntities.Load(); + StabilityStoneCoverWaveConditionsCalculationEntities.Load(); + StabilityStoneCoverWaveConditionsOutputEntities.Load(); + StochasticSoilModelEntities.Load(); + StrengthStabilityLengthwiseConstructionSectionResultEntities.Load(); + SurfaceLineEntities.Load(); + TechnicalInnovationSectionResultEntities.Load(); + WaterPressureAsphaltCoverSectionResultEntities.Load(); + WaveImpactAsphaltCoverFailureMechanismMetaEntities.Load(); + WaveImpactAsphaltCoverSectionResultEntities.Load(); + WaveImpactAsphaltCoverWaveConditionsCalculationEntities.Load(); + WaveImpactAsphaltCoverWaveConditionsOutputEntities.Load(); + + LoadIllustrationPointsIntoContext(); + } + + private void LoadIllustrationPointsIntoContext() + { + FaultTreeIllustrationPointEntities.Include(ip => ip.SubMechanismIllustrationPointEntities) + .Include(ip => ip.StochastEntities) + .Load(); + GeneralResultFaultTreeIllustrationPointEntities.Include(gr => gr.StochastEntities) + .Load(); + GeneralResultSubMechanismIllustrationPointEntities.Include(grsm => grsm.StochastEntities) + .Load(); + StochastEntities.Load(); + TopLevelFaultTreeIllustrationPointEntities.Load(); + TopLevelSubMechanismIllustrationPointEntities.Load(); + SubMechanismIllustrationPointEntities.Load(); + SubMechanismIllustrationPointStochastEntities.Load(); + IllustrationPointResultEntities.Load(); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialStabilityPointStructuresCalculationEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialStabilityPointStructuresCalculationEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialStabilityPointStructuresCalculationEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,29 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +namespace Ringtoets.Storage.Core.DbContext +{ + /// + /// Partial implementation of that implements + /// . + /// + public partial class StabilityPointStructuresCalculationEntity : IStructuresCalculationEntity {} +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialStabilityPointStructuresOutputEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialStabilityPointStructuresOutputEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PartialStabilityPointStructuresOutputEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,30 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +namespace Ringtoets.Storage.Core.DbContext +{ + /// + /// Partial implementation of that implements + /// and . + /// + public partial class StabilityPointStructuresOutputEntity : IStructuresOutputEntity, + IHasGeneralResultFaultTreeIllustrationPointEntity {} +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingCalculationEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingCalculationEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingCalculationEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,71 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class PipingCalculationEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public PipingCalculationEntity() + { + PipingCalculationOutputEntities = new HashSet(); + } + + public long PipingCalculationEntityId { get; set; } + public long CalculationGroupEntityId { get; set; } + public long? SurfaceLineEntityId { get; set; } + public long? PipingStochasticSoilProfileEntityId { get; set; } + public long? HydraulicLocationEntityId { get; set; } + public int Order { get; set; } + public string Name { get; set; } + public string Comments { get; set; } + public double? EntryPointL { get; set; } + public double? ExitPointL { get; set; } + public double? PhreaticLevelExitMean { get; set; } + public double? PhreaticLevelExitStandardDeviation { get; set; } + public double? DampingFactorExitMean { get; set; } + public double? DampingFactorExitStandardDeviation { get; set; } + public byte RelevantForScenario { get; set; } + public double? ScenarioContribution { get; set; } + public double? AssessmentLevel { get; set; } + public byte UseAssessmentLevelManualInput { get; set; } + + public virtual CalculationGroupEntity CalculationGroupEntity { get; set; } + public virtual HydraulicLocationEntity HydraulicLocationEntity { get; set; } + public virtual SurfaceLineEntity SurfaceLineEntity { get; set; } + public virtual PipingStochasticSoilProfileEntity PipingStochasticSoilProfileEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection PipingCalculationOutputEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingCalculationOutputEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingCalculationOutputEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingCalculationOutputEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,52 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class PipingCalculationOutputEntity + { + public long PipingCalculationOutputEntityId { get; set; } + public long PipingCalculationEntityId { get; set; } + public int Order { get; set; } + public double? HeaveFactorOfSafety { get; set; } + public double? HeaveZValue { get; set; } + public double? UpliftFactorOfSafety { get; set; } + public double? UpliftZValue { get; set; } + public double? SellmeijerFactorOfSafety { get; set; } + public double? SellmeijerZValue { get; set; } + public double? UpliftEffectiveStress { get; set; } + public double? HeaveGradient { get; set; } + public double? SellmeijerCreepCoefficient { get; set; } + public double? SellmeijerCriticalFall { get; set; } + public double? SellmeijerReducedFall { get; set; } + + public virtual PipingCalculationEntity PipingCalculationEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingCharacteristicPointEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingCharacteristicPointEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingCharacteristicPointEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,44 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class PipingCharacteristicPointEntity + { + public long PipingCharacteristicPointEntityId { get; set; } + public long SurfaceLineEntityId { get; set; } + public byte Type { get; set; } + public double? X { get; set; } + public double? Y { get; set; } + public double? Z { get; set; } + + public virtual SurfaceLineEntity SurfaceLineEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingCharacteristicPointType.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingCharacteristicPointType.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingCharacteristicPointType.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,63 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using Core.Common.Base.Geometry; +using Ringtoets.Piping.Primitives; + +namespace Ringtoets.Storage.Core.DbContext +{ + /// + /// Denotes a as being used to mark a particular + /// characteristic point of a . + /// + public enum PipingCharacteristicPointType + { + /// + /// Corresponds to . + /// + DikeToeAtRiver = 1, + + /// + /// Corresponds to . + /// + DikeToeAtPolder = 2, + + /// + /// Corresponds to . + /// + DitchDikeSide = 3, + + /// + /// Corresponds to . + /// + BottomDitchDikeSide = 4, + + /// + /// Corresponds to . + /// + BottomDitchPolderSide = 5, + + /// + /// Corresponds to . + /// + DitchPolderSide = 6 + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingFailureMechanismMetaEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingFailureMechanismMetaEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingFailureMechanismMetaEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,44 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class PipingFailureMechanismMetaEntity + { + public long PipingFailureMechanismMetaEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public double A { get; set; } + public double WaterVolumetricWeight { get; set; } + public string StochasticSoilModelCollectionSourcePath { get; set; } + public string SurfaceLineCollectionSourcePath { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingSectionResultEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingSectionResultEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingSectionResultEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,46 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class PipingSectionResultEntity + { + public long PipingSectionResultEntityId { get; set; } + public long FailureMechanismSectionEntityId { get; set; } + public byte SimpleAssessmentResult { get; set; } + public byte DetailedAssessmentResult { get; set; } + public byte TailorMadeAssessmentResult { get; set; } + public double? TailorMadeAssessmentProbability { get; set; } + public byte UseManualAssembly { get; set; } + public double? ManualAssemblyProbability { get; set; } + + public virtual FailureMechanismSectionEntity FailureMechanismSectionEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingSoilLayerEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingSoilLayerEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingSoilLayerEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,52 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class PipingSoilLayerEntity + { + public long PipingSoilLayerEntityId { get; set; } + public long PipingSoilProfileEntityId { get; set; } + public double? Top { get; set; } + public byte IsAquifer { get; set; } + public long? Color { get; set; } + public string MaterialName { get; set; } + public double? BelowPhreaticLevelMean { get; set; } + public double? BelowPhreaticLevelDeviation { get; set; } + public double? BelowPhreaticLevelShift { get; set; } + public double? DiameterD70Mean { get; set; } + public double? DiameterD70CoefficientOfVariation { get; set; } + public double? PermeabilityMean { get; set; } + public double? PermeabilityCoefficientOfVariation { get; set; } + public int Order { get; set; } + + public virtual PipingSoilProfileEntity PipingSoilProfileEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingSoilProfileEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingSoilProfileEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingSoilProfileEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,56 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class PipingSoilProfileEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public PipingSoilProfileEntity() + { + PipingSoilLayerEntities = new HashSet(); + PipingStochasticSoilProfileEntities = new HashSet(); + } + + public long PipingSoilProfileEntityId { get; set; } + public double? Bottom { get; set; } + public string Name { get; set; } + public byte SourceType { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection PipingSoilLayerEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection PipingStochasticSoilProfileEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingStochasticSoilProfileEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingStochasticSoilProfileEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingStochasticSoilProfileEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,56 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class PipingStochasticSoilProfileEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public PipingStochasticSoilProfileEntity() + { + PipingCalculationEntities = new HashSet(); + } + + public long PipingStochasticSoilProfileEntityId { get; set; } + public long PipingSoilProfileEntityId { get; set; } + public long StochasticSoilModelEntityId { get; set; } + public double Probability { get; set; } + public int Order { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection PipingCalculationEntities { get; set; } + + public virtual PipingSoilProfileEntity PipingSoilProfileEntity { get; set; } + public virtual StochasticSoilModelEntity StochasticSoilModelEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingStructureFailureMechanismMetaEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingStructureFailureMechanismMetaEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingStructureFailureMechanismMetaEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,41 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class PipingStructureFailureMechanismMetaEntity + { + public long PipingStructureFailureMechanismMetaEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public double N { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingStructureSectionResultEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingStructureSectionResultEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/PipingStructureSectionResultEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,45 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class PipingStructureSectionResultEntity + { + public long PipingStructureSectionResultEntityId { get; set; } + public long FailureMechanismSectionEntityId { get; set; } + public byte SimpleAssessmentResult { get; set; } + public byte DetailedAssessmentResult { get; set; } + public byte TailorMadeAssessmentResult { get; set; } + public byte UseManualAssembly { get; set; } + public byte ManualAssemblyCategoryGroup { get; set; } + + public virtual FailureMechanismSectionEntity FailureMechanismSectionEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ProjectEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ProjectEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/ProjectEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,50 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class ProjectEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public ProjectEntity() + { + AssessmentSectionEntities = new HashSet(); + } + + public long ProjectEntityId { get; set; } + public string Description { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection AssessmentSectionEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.Context.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.Context.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.Context.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,144 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Data.Entity; +using System.Data.Entity.Infrastructure; + +namespace Ringtoets.Storage.Core.DbContext +{ + public partial class RiskeerEntities : System.Data.Entity.DbContext + { + public virtual DbSet AssessmentSectionEntities { get; set; } + public virtual DbSet BackgroundDataEntities { get; set; } + public virtual DbSet BackgroundDataMetaEntities { get; set; } + public virtual DbSet CalculationGroupEntities { get; set; } + public virtual DbSet ClosingStructureEntities { get; set; } + public virtual DbSet ClosingStructuresCalculationEntities { get; set; } + public virtual DbSet ClosingStructuresFailureMechanismMetaEntities { get; set; } + public virtual DbSet ClosingStructuresOutputEntities { get; set; } + public virtual DbSet ClosingStructuresSectionResultEntities { get; set; } + public virtual DbSet DikeProfileEntities { get; set; } + public virtual DbSet DuneErosionFailureMechanismMetaEntities { get; set; } + public virtual DbSet DuneErosionSectionResultEntities { get; set; } + public virtual DbSet DuneLocationCalculationCollectionEntities { get; set; } + public virtual DbSet DuneLocationCalculationEntities { get; set; } + public virtual DbSet DuneLocationCalculationOutputEntities { get; set; } + public virtual DbSet DuneLocationEntities { get; set; } + public virtual DbSet FailureMechanismEntities { get; set; } + public virtual DbSet FailureMechanismSectionEntities { get; set; } + public virtual DbSet FaultTreeIllustrationPointEntities { get; set; } + public virtual DbSet ForeshoreProfileEntities { get; set; } + public virtual DbSet GeneralResultFaultTreeIllustrationPointEntities { get; set; } + public virtual DbSet GeneralResultSubMechanismIllustrationPointEntities { get; set; } + public virtual DbSet GrassCoverErosionInwardsCalculationEntities { get; set; } + public virtual DbSet GrassCoverErosionInwardsDikeHeightOutputEntities { get; set; } + public virtual DbSet GrassCoverErosionInwardsFailureMechanismMetaEntities { get; set; } + public virtual DbSet GrassCoverErosionInwardsOutputEntities { get; set; } + public virtual DbSet GrassCoverErosionInwardsOvertoppingRateOutputEntities { get; set; } + public virtual DbSet GrassCoverErosionInwardsSectionResultEntities { get; set; } + public virtual DbSet GrassCoverErosionOutwardsFailureMechanismMetaEntities { get; set; } + public virtual DbSet GrassCoverErosionOutwardsSectionResultEntities { get; set; } + public virtual DbSet GrassCoverErosionOutwardsWaveConditionsCalculationEntities { get; set; } + public virtual DbSet GrassCoverErosionOutwardsWaveConditionsOutputEntities { get; set; } + public virtual DbSet GrassCoverSlipOffInwardsSectionResultEntities { get; set; } + public virtual DbSet GrassCoverSlipOffOutwardsSectionResultEntities { get; set; } + public virtual DbSet HeightStructureEntities { get; set; } + public virtual DbSet HeightStructuresCalculationEntities { get; set; } + public virtual DbSet HeightStructuresFailureMechanismMetaEntities { get; set; } + public virtual DbSet HeightStructuresOutputEntities { get; set; } + public virtual DbSet HeightStructuresSectionResultEntities { get; set; } + public virtual DbSet HydraulicBoundaryDatabaseEntities { get; set; } + public virtual DbSet HydraulicLocationCalculationCollectionEntities { get; set; } + public virtual DbSet HydraulicLocationCalculationEntities { get; set; } + public virtual DbSet HydraulicLocationEntities { get; set; } + public virtual DbSet HydraulicLocationOutputEntities { get; set; } + public virtual DbSet IllustrationPointResultEntities { get; set; } + public virtual DbSet MacroStabilityInwardsCalculationEntities { get; set; } + public virtual DbSet MacroStabilityInwardsCalculationOutputEntities { get; set; } + public virtual DbSet MacroStabilityInwardsCharacteristicPointEntities { get; set; } + public virtual DbSet MacroStabilityInwardsFailureMechanismMetaEntities { get; set; } + public virtual DbSet MacroStabilityInwardsPreconsolidationStressEntities { get; set; } + public virtual DbSet MacroStabilityInwardsSectionResultEntities { get; set; } + public virtual DbSet MacroStabilityInwardsSoilLayerOneDEntities { get; set; } + public virtual DbSet MacroStabilityInwardsSoilLayerTwoDEntities { get; set; } + public virtual DbSet MacroStabilityInwardsSoilProfileOneDEntities { get; set; } + public virtual DbSet MacroStabilityInwardsSoilProfileTwoDEntities { get; set; } + public virtual DbSet MacroStabilityInwardsStochasticSoilProfileEntities { get; set; } + public virtual DbSet MacroStabilityOutwardsFailureMechanismMetaEntities { get; set; } + public virtual DbSet MacroStabilityOutwardsSectionResultEntities { get; set; } + public virtual DbSet MicrostabilitySectionResultEntities { get; set; } + public virtual DbSet PipingCalculationEntities { get; set; } + public virtual DbSet PipingCalculationOutputEntities { get; set; } + public virtual DbSet PipingCharacteristicPointEntities { get; set; } + public virtual DbSet PipingFailureMechanismMetaEntities { get; set; } + public virtual DbSet PipingSectionResultEntities { get; set; } + public virtual DbSet PipingSoilLayerEntities { get; set; } + public virtual DbSet PipingSoilProfileEntities { get; set; } + public virtual DbSet PipingStochasticSoilProfileEntities { get; set; } + public virtual DbSet PipingStructureFailureMechanismMetaEntities { get; set; } + public virtual DbSet PipingStructureSectionResultEntities { get; set; } + public virtual DbSet ProjectEntities { get; set; } + public virtual DbSet StabilityPointStructureEntities { get; set; } + public virtual DbSet StabilityPointStructuresCalculationEntities { get; set; } + public virtual DbSet StabilityPointStructuresFailureMechanismMetaEntities { get; set; } + public virtual DbSet StabilityPointStructuresOutputEntities { get; set; } + public virtual DbSet StabilityPointStructuresSectionResultEntities { get; set; } + public virtual DbSet StabilityStoneCoverFailureMechanismMetaEntities { get; set; } + public virtual DbSet StabilityStoneCoverSectionResultEntities { get; set; } + public virtual DbSet StabilityStoneCoverWaveConditionsCalculationEntities { get; set; } + public virtual DbSet StabilityStoneCoverWaveConditionsOutputEntities { get; set; } + public virtual DbSet StochastEntities { get; set; } + public virtual DbSet StochasticSoilModelEntities { get; set; } + public virtual DbSet StrengthStabilityLengthwiseConstructionSectionResultEntities { get; set; } + public virtual DbSet SubMechanismIllustrationPointEntities { get; set; } + public virtual DbSet SubMechanismIllustrationPointStochastEntities { get; set; } + public virtual DbSet SurfaceLineEntities { get; set; } + public virtual DbSet TechnicalInnovationSectionResultEntities { get; set; } + public virtual DbSet TopLevelFaultTreeIllustrationPointEntities { get; set; } + public virtual DbSet TopLevelSubMechanismIllustrationPointEntities { get; set; } + public virtual DbSet VersionEntities { get; set; } + public virtual DbSet WaterPressureAsphaltCoverSectionResultEntities { get; set; } + public virtual DbSet WaveImpactAsphaltCoverFailureMechanismMetaEntities { get; set; } + public virtual DbSet WaveImpactAsphaltCoverSectionResultEntities { get; set; } + public virtual DbSet WaveImpactAsphaltCoverWaveConditionsCalculationEntities { get; set; } + public virtual DbSet WaveImpactAsphaltCoverWaveConditionsOutputEntities { get; set; } + + /// + /// This method is called in a 'code first' approach when the model for a derived has been initialized, + /// but before the model has been locked down and used to initialize the . + /// + /// The that defines the model for the context being created. + /// Thrown because the is created in a 'code first' approach. + protected override void OnModelCreating(DbModelBuilder modelBuilder) + { + throw new UnintentionalCodeFirstException(); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.Context.tt =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.Context.tt (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.Context.tt (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,634 @@ +<#@ template language="C#" debug="false" hostspecific="true"#> +<#@ include file="EF6.Utility.CS.ttinclude"#><#@ + output extension=".cs"#><# + +const string inputFile = @"RiskeerEntities.edmx"; +var textTransform = DynamicTextTransformation.Create(this); +var code = new CodeGenerationTools(this); +var ef = new MetadataTools(this); +var typeMapper = new TypeMapper(code, ef, textTransform.Errors); +var loader = new EdmMetadataLoader(textTransform.Host, textTransform.Errors); +var itemCollection = loader.CreateEdmItemCollection(inputFile); +var modelNamespace = loader.GetModelNamespace(inputFile); +var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef); + +var container = itemCollection.OfType().FirstOrDefault(); +if (container == null) +{ + return string.Empty; +} +#> +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#> +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#> +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#> +// +//------------------------------------------------------------------------------ + +using System.Data.Entity; +using System.Data.Entity.Infrastructure; +<# +if (container.FunctionImports.Any()) +{ +#> +using System.Data.Entity.Core.Objects; +using System.Linq; +<# +} +#> + +<# +var codeNamespace = code.VsNamespaceSuggestion(); +if (!String.IsNullOrEmpty(codeNamespace)) +{ +#> +namespace <#=code.EscapeNamespace(codeNamespace)#> +{ +<# + PushIndent(" "); +} +#> +<#=Accessibility.ForType(container)#> partial class <#=code.Escape(container)#> : System.Data.Entity.DbContext +{ +<# + foreach (var entitySet in container.BaseEntitySets.OfType()) + { +#> + <#=codeStringGenerator.DbSet(entitySet)#> +<# + } + + foreach (var edmFunction in container.FunctionImports) + { + WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: false); + } +#> + + /// + /// This method is called in a 'code first' approach when the model for a derived has been initialized, + /// but before the model has been locked down and used to initialize the . + /// + /// The that defines the model for the context being created. + /// Thrown because the is created in a 'code first' approach. + protected override void OnModelCreating(DbModelBuilder modelBuilder) + { + throw new UnintentionalCodeFirstException(); + } +} +<# + +if (!String.IsNullOrEmpty(codeNamespace)) +{ + PopIndent(); +#> +}<# +} +#> +<#+ + +private void WriteFunctionImport(TypeMapper typeMapper, CodeStringGenerator codeStringGenerator, EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) +{ + if (typeMapper.IsComposable(edmFunction)) + { +#> + + [DbFunction("<#=edmFunction.NamespaceName#>", "<#=edmFunction.Name#>")] + <#=codeStringGenerator.ComposableFunctionMethod(edmFunction, modelNamespace)#> + { +<#+ + codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter); +#> + <#=codeStringGenerator.ComposableCreateQuery(edmFunction, modelNamespace)#> + } +<#+ + } + else + { +#> + + <#=codeStringGenerator.FunctionMethod(edmFunction, modelNamespace, includeMergeOption)#> + { +<#+ + codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter); +#> + <#=codeStringGenerator.ExecuteFunction(edmFunction, modelNamespace, includeMergeOption)#> + } +<#+ + if (typeMapper.GenerateMergeOptionFunction(edmFunction, includeMergeOption)) + { + WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: true); + } + } +} + +public void WriteFunctionParameter(string name, string isNotNull, string notNullInit, string nullInit) +{ +#> + var <#=name#> = <#=isNotNull#> ? + <#=notNullInit#> : + <#=nullInit#>; + +<#+ +} + +public const string TemplateId = "CSharp_DbContext_Context_EF6"; + +public class CodeStringGenerator +{ + private readonly CodeGenerationTools _code; + private readonly TypeMapper _typeMapper; + private readonly MetadataTools _ef; + + public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef) + { + ArgumentNotNull(code, "code"); + ArgumentNotNull(typeMapper, "typeMapper"); + ArgumentNotNull(ef, "ef"); + + _code = code; + _typeMapper = typeMapper; + _ef = ef; + } + + public string Property(EdmProperty edmProperty) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2} {{ {3}get; {4}set; }}", + Accessibility.ForProperty(edmProperty), + _typeMapper.GetTypeName(edmProperty.TypeUsage), + _code.Escape(edmProperty), + _code.SpaceAfter(Accessibility.ForGetter(edmProperty)), + _code.SpaceAfter(Accessibility.ForSetter(edmProperty))); + } + + public string NavigationProperty(NavigationProperty navProp) + { + var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType()); + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2} {{ {3}get; {4}set; }}", + AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)), + navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType, + _code.Escape(navProp), + _code.SpaceAfter(Accessibility.ForGetter(navProp)), + _code.SpaceAfter(Accessibility.ForSetter(navProp))); + } + + public string AccessibilityAndVirtual(string accessibility) + { + return accessibility + (accessibility != "private" ? " virtual" : ""); + } + + public string EntityClassOpening(EntityType entity) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1}partial class {2}{3}", + Accessibility.ForType(entity), + _code.SpaceAfter(_code.AbstractOption(entity)), + _code.Escape(entity), + _code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType))); + } + + public string EnumOpening(SimpleType enumType) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} enum {1} : {2}", + Accessibility.ForType(enumType), + _code.Escape(enumType), + _code.Escape(_typeMapper.UnderlyingClrType(enumType))); + } + + public void WriteFunctionParameters(EdmFunction edmFunction, Action writeParameter) + { + var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); + foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable)) + { + var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"; + var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")"; + var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))"; + writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit); + } + } + + public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace) + { + var parameters = _typeMapper.GetParameters(edmFunction); + + return string.Format( + CultureInfo.InvariantCulture, + "{0} IQueryable<{1}> {2}({3})", + AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), + _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), + _code.Escape(edmFunction), + string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray())); + } + + public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace) + { + var parameters = _typeMapper.GetParameters(edmFunction); + + return string.Format( + CultureInfo.InvariantCulture, + "return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});", + _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), + edmFunction.NamespaceName, + edmFunction.Name, + string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()), + _code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()))); + } + + public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) + { + var parameters = _typeMapper.GetParameters(edmFunction); + var returnType = _typeMapper.GetReturnType(edmFunction); + + var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()); + if (includeMergeOption) + { + paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption"; + } + + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2}({3})", + AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), + returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", + _code.Escape(edmFunction), + paramList); + } + + public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) + { + var parameters = _typeMapper.GetParameters(edmFunction); + var returnType = _typeMapper.GetReturnType(edmFunction); + + var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); + if (includeMergeOption) + { + callParams = ", mergeOption" + callParams; + } + + return string.Format( + CultureInfo.InvariantCulture, + "return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});", + returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", + edmFunction.Name, + callParams); + } + + public string DbSet(EntitySet entitySet) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} virtual DbSet<{1}> {2} {{ get; set; }}", + Accessibility.ForReadOnlyProperty(entitySet), + _typeMapper.GetTypeName(entitySet.ElementType), + _code.Escape(entitySet)); + } + + public string DbSetInitializer(EntitySet entitySet) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} = Set<{1}>();", + _code.Escape(entitySet), + _typeMapper.GetTypeName(entitySet.ElementType)); + } + + public string UsingDirectives(bool inHeader, bool includeCollections = true) + { + return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion()) + ? string.Format( + CultureInfo.InvariantCulture, + "{0}using System;{1}" + + "{2}", + inHeader ? Environment.NewLine : "", + includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "", + inHeader ? "" : Environment.NewLine) + : ""; + } +} + +public class TypeMapper +{ + private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName"; + + private readonly System.Collections.IList _errors; + private readonly CodeGenerationTools _code; + private readonly MetadataTools _ef; + + public static string FixNamespaces(string typeName) + { + return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial."); + } + + public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors) + { + ArgumentNotNull(code, "code"); + ArgumentNotNull(ef, "ef"); + ArgumentNotNull(errors, "errors"); + + _code = code; + _ef = ef; + _errors = errors; + } + + public string GetTypeName(TypeUsage typeUsage) + { + return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null); + } + + public string GetTypeName(EdmType edmType) + { + return GetTypeName(edmType, isNullable: null, modelNamespace: null); + } + + public string GetTypeName(TypeUsage typeUsage, string modelNamespace) + { + return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace); + } + + public string GetTypeName(EdmType edmType, string modelNamespace) + { + return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace); + } + + public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace) + { + if (edmType == null) + { + return null; + } + + var collectionType = edmType as CollectionType; + if (collectionType != null) + { + return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace)); + } + + var typeName = _code.Escape(edmType.MetadataProperties + .Where(p => p.Name == ExternalTypeNameAttributeName) + .Select(p => (string)p.Value) + .FirstOrDefault()) + ?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ? + _code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) : + _code.Escape(edmType)); + + if (edmType is StructuralType) + { + return typeName; + } + + if (edmType is SimpleType) + { + var clrType = UnderlyingClrType(edmType); + if (!IsEnumType(edmType)) + { + typeName = _code.Escape(clrType); + } + + typeName = FixNamespaces(typeName); + + return clrType.IsValueType && isNullable == true ? + String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) : + typeName; + } + + throw new ArgumentException("edmType"); + } + + public Type UnderlyingClrType(EdmType edmType) + { + ArgumentNotNull(edmType, "edmType"); + + var primitiveType = edmType as PrimitiveType; + if (primitiveType != null) + { + return primitiveType.ClrEquivalentType; + } + + if (IsEnumType(edmType)) + { + return GetEnumUnderlyingType(edmType).ClrEquivalentType; + } + + return typeof(object); + } + + public object GetEnumMemberValue(MetadataItem enumMember) + { + ArgumentNotNull(enumMember, "enumMember"); + + var valueProperty = enumMember.GetType().GetProperty("Value"); + return valueProperty == null ? null : valueProperty.GetValue(enumMember, null); + } + + public string GetEnumMemberName(MetadataItem enumMember) + { + ArgumentNotNull(enumMember, "enumMember"); + + var nameProperty = enumMember.GetType().GetProperty("Name"); + return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null); + } + + public System.Collections.IEnumerable GetEnumMembers(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + var membersProperty = enumType.GetType().GetProperty("Members"); + return membersProperty != null + ? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null) + : Enumerable.Empty(); + } + + public bool EnumIsFlags(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + var isFlagsProperty = enumType.GetType().GetProperty("IsFlags"); + return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null); + } + + public bool IsEnumType(GlobalItem edmType) + { + ArgumentNotNull(edmType, "edmType"); + + return edmType.GetType().Name == "EnumType"; + } + + public PrimitiveType GetEnumUnderlyingType(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null); + } + + public string CreateLiteral(object value) + { + if (value == null || value.GetType() != typeof(TimeSpan)) + { + return _code.CreateLiteral(value); + } + + return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks); + } + + public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable types, string sourceFile) + { + ArgumentNotNull(types, "types"); + ArgumentNotNull(sourceFile, "sourceFile"); + + var hash = new HashSet(StringComparer.InvariantCultureIgnoreCase); + if (types.Any(item => !hash.Add(item))) + { + _errors.Add( + new CompilerError(sourceFile, -1, -1, "6023", + String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict")))); + return false; + } + return true; + } + + public IEnumerable GetEnumItemsToGenerate(IEnumerable itemCollection) + { + return GetItemsToGenerate(itemCollection) + .Where(e => IsEnumType(e)); + } + + public IEnumerable GetItemsToGenerate(IEnumerable itemCollection) where T: EdmType + { + return itemCollection + .OfType() + .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName)) + .OrderBy(i => i.Name); + } + + public IEnumerable GetAllGlobalItems(IEnumerable itemCollection) + { + return itemCollection + .Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i)) + .Select(g => GetGlobalItemName(g)); + } + + public string GetGlobalItemName(GlobalItem item) + { + if (item is EdmType) + { + return ((EdmType)item).Name; + } + else + { + return ((EntityContainer)item).Name; + } + } + + public IEnumerable GetSimpleProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetSimpleProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetPropertiesWithDefaultValues(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetPropertiesWithDefaultValues(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetNavigationProperties(EntityType type) + { + return type.NavigationProperties.Where(np => np.DeclaringType == type); + } + + public IEnumerable GetCollectionNavigationProperties(EntityType type) + { + return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); + } + + public FunctionParameter GetReturnParameter(EdmFunction edmFunction) + { + ArgumentNotNull(edmFunction, "edmFunction"); + + var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters"); + return returnParamsProperty == null + ? edmFunction.ReturnParameter + : ((IEnumerable)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault(); + } + + public bool IsComposable(EdmFunction edmFunction) + { + ArgumentNotNull(edmFunction, "edmFunction"); + + var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute"); + return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null); + } + + public IEnumerable GetParameters(EdmFunction edmFunction) + { + return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); + } + + public TypeUsage GetReturnType(EdmFunction edmFunction) + { + var returnParam = GetReturnParameter(edmFunction); + return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage); + } + + public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption) + { + var returnType = GetReturnType(edmFunction); + return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType; + } +} + +public static void ArgumentNotNull(T arg, string name) where T : class +{ + if (arg == null) + { + throw new ArgumentNullException(name); + } +} +#> \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.Designer.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.Designer.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.Designer.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,31 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +// T4 code generation is enabled for model 'C:\Repos\Riskeer\Ringtoets\Storage\src\Ringtoets.Storage.Core\DbContext\RiskeerEntities.edmx'. +// To enable legacy code generation, change the value of the 'Code Generation Strategy' designer +// property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model +// is open in the designer. + +// If no context and entity classes have been generated, it may be because you created an empty model but +// have not yet chosen which version of Entity Framework to use. To generate a context class and entity +// classes for your model, open the model in the designer, right-click on the designer surface, and +// select 'Update Model from Database...', 'Generate Database from Model...', or 'Add Code Generation +// Item...'. \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,30 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.edmx =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.edmx (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.edmx (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,10042 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.edmx.diagram =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.edmx.diagram (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.edmx.diagram (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,530 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>>>>>>> 1579 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.tt =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.tt (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/RiskeerEntities.tt (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,754 @@ +<#@ template language="C#" debug="false" hostspecific="true"#> +<#@ include file="EF6.Utility.CS.ttinclude"#><#@ + output extension=".cs"#><# + +const string inputFile = @"RiskeerEntities.edmx"; +var textTransform = DynamicTextTransformation.Create(this); +var code = new CodeGenerationTools(this); +var ef = new MetadataTools(this); +var typeMapper = new TypeMapper(code, ef, textTransform.Errors); +var fileManager = EntityFrameworkTemplateFileManager.Create(this); +var itemCollection = new EdmMetadataLoader(textTransform.Host, textTransform.Errors).CreateEdmItemCollection(inputFile); +var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef); + +if (!typeMapper.VerifyCaseInsensitiveTypeUniqueness(typeMapper.GetAllGlobalItems(itemCollection), inputFile)) +{ + return string.Empty; +} + +WriteHeader(codeStringGenerator, fileManager); + +foreach (var entity in typeMapper.GetItemsToGenerate(itemCollection)) +{ + fileManager.StartNewFile(entity.Name + ".cs"); + BeginNamespace(code); +#> +<#=codeStringGenerator.UsingDirectives(inHeader: false)#> +<#=codeStringGenerator.EntityClassOpening(entity)#> +{ +<# + var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(entity); + var collectionNavigationProperties = typeMapper.GetCollectionNavigationProperties(entity); + var complexProperties = typeMapper.GetComplexProperties(entity); + + if (propertiesWithDefaultValues.Any() || collectionNavigationProperties.Any() || complexProperties.Any()) + { +#> + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public <#=code.Escape(entity)#>() + { +<# + foreach (var edmProperty in propertiesWithDefaultValues) + { +#> + <#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>; +<# + } + + foreach (var navigationProperty in collectionNavigationProperties) + { +#> + <#=code.Escape(navigationProperty)#> = new HashSet<<#=typeMapper.GetTypeName(navigationProperty.ToEndMember.GetEntityType())#>>(); +<# + } + + foreach (var complexProperty in complexProperties) + { +#> + <#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>(); +<# + } +#> + } + +<# + } + + var simpleProperties = typeMapper.GetSimpleProperties(entity); + if (simpleProperties.Any()) + { + foreach (var edmProperty in simpleProperties) + { +#> + <#=codeStringGenerator.Property(edmProperty)#> +<# + } + } + + if (complexProperties.Any()) + { +#> + +<# + foreach(var complexProperty in complexProperties) + { +#> + <#=codeStringGenerator.Property(complexProperty)#> +<# + } + } + + var navigationProperties = typeMapper.GetNavigationProperties(entity); + if (navigationProperties.Any()) + { +#> + +<# + foreach (var navigationProperty in navigationProperties) + { + if (navigationProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many) + { +#> + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] +<# + } +#> + <#=codeStringGenerator.NavigationProperty(navigationProperty)#> +<# + } + } +#> +} +<# + EndNamespace(code); +} + +foreach (var complex in typeMapper.GetItemsToGenerate(itemCollection)) +{ + fileManager.StartNewFile(complex.Name + ".cs"); + BeginNamespace(code); +#> +<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#> +<#=Accessibility.ForType(complex)#> partial class <#=code.Escape(complex)#> +{ +<# + var complexProperties = typeMapper.GetComplexProperties(complex); + var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(complex); + + if (propertiesWithDefaultValues.Any() || complexProperties.Any()) + { +#> + public <#=code.Escape(complex)#>() + { +<# + foreach (var edmProperty in propertiesWithDefaultValues) + { +#> + this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>; +<# + } + + foreach (var complexProperty in complexProperties) + { +#> + this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>(); +<# + } +#> + } + +<# + } + + var simpleProperties = typeMapper.GetSimpleProperties(complex); + if (simpleProperties.Any()) + { + foreach(var edmProperty in simpleProperties) + { +#> + <#=codeStringGenerator.Property(edmProperty)#> +<# + } + } + + if (complexProperties.Any()) + { +#> + +<# + foreach(var edmProperty in complexProperties) + { +#> + <#=codeStringGenerator.Property(edmProperty)#> +<# + } + } +#> +} +<# + EndNamespace(code); +} + +foreach (var enumType in typeMapper.GetEnumItemsToGenerate(itemCollection)) +{ + fileManager.StartNewFile(enumType.Name + ".cs"); + BeginNamespace(code); +#> +<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#> +<# + if (typeMapper.EnumIsFlags(enumType)) + { +#> +[Flags] +<# + } +#> +<#=codeStringGenerator.EnumOpening(enumType)#> +{ +<# + var foundOne = false; + + foreach (MetadataItem member in typeMapper.GetEnumMembers(enumType)) + { + foundOne = true; +#> + <#=code.Escape(typeMapper.GetEnumMemberName(member))#> = <#=typeMapper.GetEnumMemberValue(member)#>, +<# + } + + if (foundOne) + { + this.GenerationEnvironment.Remove(this.GenerationEnvironment.Length - 3, 1); + } +#> +} +<# + EndNamespace(code); +} + +fileManager.Process(); + +#> +<#+ + +public void WriteHeader(CodeStringGenerator codeStringGenerator, EntityFrameworkTemplateFileManager fileManager) +{ + fileManager.StartHeader(); +#> +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#> +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#> +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#> +// +//------------------------------------------------------------------------------ +<#=codeStringGenerator.UsingDirectives(inHeader: true)#> +<#+ + fileManager.EndBlock(); +} + +public void BeginNamespace(CodeGenerationTools code) +{ + var codeNamespace = code.VsNamespaceSuggestion(); + if (!String.IsNullOrEmpty(codeNamespace)) + { +#> +namespace <#=code.EscapeNamespace(codeNamespace)#> +{ +<#+ + PushIndent(" "); + } +} + +public void EndNamespace(CodeGenerationTools code) +{ + if (!String.IsNullOrEmpty(code.VsNamespaceSuggestion())) + { + PopIndent(); +#> +} +<#+ + } +} + +public const string TemplateId = "CSharp_DbContext_Types_EF6"; + +public class CodeStringGenerator +{ + private readonly CodeGenerationTools _code; + private readonly TypeMapper _typeMapper; + private readonly MetadataTools _ef; + + public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef) + { + ArgumentNotNull(code, "code"); + ArgumentNotNull(typeMapper, "typeMapper"); + ArgumentNotNull(ef, "ef"); + + _code = code; + _typeMapper = typeMapper; + _ef = ef; + } + + public string Property(EdmProperty edmProperty) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2} {{ {3}get; {4}set; }}", + Accessibility.ForProperty(edmProperty), + _typeMapper.GetTypeName(edmProperty.TypeUsage), + _code.Escape(edmProperty), + _code.SpaceAfter(Accessibility.ForGetter(edmProperty)), + _code.SpaceAfter(Accessibility.ForSetter(edmProperty))); + } + + public string NavigationProperty(NavigationProperty navProp) + { + var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType()); + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2} {{ {3}get; {4}set; }}", + AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)), + navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType, + _code.Escape(navProp), + _code.SpaceAfter(Accessibility.ForGetter(navProp)), + _code.SpaceAfter(Accessibility.ForSetter(navProp))); + } + + public string AccessibilityAndVirtual(string accessibility) + { + return accessibility + (accessibility != "private" ? " virtual" : ""); + } + + public string EntityClassOpening(EntityType entity) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1}partial class {2}{3}", + Accessibility.ForType(entity), + _code.SpaceAfter(_code.AbstractOption(entity)), + _code.Escape(entity), + _code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType))); + } + + public string EnumOpening(SimpleType enumType) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} enum {1} : {2}", + Accessibility.ForType(enumType), + _code.Escape(enumType), + _code.Escape(_typeMapper.UnderlyingClrType(enumType))); + } + + public void WriteFunctionParameters(EdmFunction edmFunction, Action writeParameter) + { + var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); + foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable)) + { + var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"; + var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")"; + var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))"; + writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit); + } + } + + public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace) + { + var parameters = _typeMapper.GetParameters(edmFunction); + + return string.Format( + CultureInfo.InvariantCulture, + "{0} IQueryable<{1}> {2}({3})", + AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), + _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), + _code.Escape(edmFunction), + string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray())); + } + + public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace) + { + var parameters = _typeMapper.GetParameters(edmFunction); + + return string.Format( + CultureInfo.InvariantCulture, + "return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});", + _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace), + edmFunction.NamespaceName, + edmFunction.Name, + string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()), + _code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()))); + } + + public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) + { + var parameters = _typeMapper.GetParameters(edmFunction); + var returnType = _typeMapper.GetReturnType(edmFunction); + + var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()); + if (includeMergeOption) + { + paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption"; + } + + return string.Format( + CultureInfo.InvariantCulture, + "{0} {1} {2}({3})", + AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)), + returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", + _code.Escape(edmFunction), + paramList); + } + + public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption) + { + var parameters = _typeMapper.GetParameters(edmFunction); + var returnType = _typeMapper.GetReturnType(edmFunction); + + var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); + if (includeMergeOption) + { + callParams = ", mergeOption" + callParams; + } + + return string.Format( + CultureInfo.InvariantCulture, + "return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});", + returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">", + edmFunction.Name, + callParams); + } + + public string DbSet(EntitySet entitySet) + { + return string.Format( + CultureInfo.InvariantCulture, + "{0} virtual DbSet<{1}> {2} {{ get; set; }}", + Accessibility.ForReadOnlyProperty(entitySet), + _typeMapper.GetTypeName(entitySet.ElementType), + _code.Escape(entitySet)); + } + + public string UsingDirectives(bool inHeader, bool includeCollections = true) + { + return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion()) + ? string.Format( + CultureInfo.InvariantCulture, + "{0}using System;{1}" + + "{2}", + inHeader ? Environment.NewLine : "", + includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "", + inHeader ? "" : Environment.NewLine) + : ""; + } +} + +public class TypeMapper +{ + private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName"; + + private readonly System.Collections.IList _errors; + private readonly CodeGenerationTools _code; + private readonly MetadataTools _ef; + + public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors) + { + ArgumentNotNull(code, "code"); + ArgumentNotNull(ef, "ef"); + ArgumentNotNull(errors, "errors"); + + _code = code; + _ef = ef; + _errors = errors; + } + + public static string FixNamespaces(string typeName) + { + return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial."); + } + + public string GetTypeName(TypeUsage typeUsage) + { + return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null); + } + + public string GetTypeName(EdmType edmType) + { + return GetTypeName(edmType, isNullable: null, modelNamespace: null); + } + + public string GetTypeName(TypeUsage typeUsage, string modelNamespace) + { + return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace); + } + + public string GetTypeName(EdmType edmType, string modelNamespace) + { + return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace); + } + + public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace) + { + if (edmType == null) + { + return null; + } + + var collectionType = edmType as CollectionType; + if (collectionType != null) + { + return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace)); + } + + var typeName = _code.Escape(edmType.MetadataProperties + .Where(p => p.Name == ExternalTypeNameAttributeName) + .Select(p => (string)p.Value) + .FirstOrDefault()) + ?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ? + _code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) : + _code.Escape(edmType)); + + if (edmType is StructuralType) + { + return typeName; + } + + if (edmType is SimpleType) + { + var clrType = UnderlyingClrType(edmType); + if (!IsEnumType(edmType)) + { + typeName = _code.Escape(clrType); + } + + typeName = FixNamespaces(typeName); + + return clrType.IsValueType && isNullable == true ? + String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) : + typeName; + } + + throw new ArgumentException("edmType"); + } + + public Type UnderlyingClrType(EdmType edmType) + { + ArgumentNotNull(edmType, "edmType"); + + var primitiveType = edmType as PrimitiveType; + if (primitiveType != null) + { + return primitiveType.ClrEquivalentType; + } + + if (IsEnumType(edmType)) + { + return GetEnumUnderlyingType(edmType).ClrEquivalentType; + } + + return typeof(object); + } + + public object GetEnumMemberValue(MetadataItem enumMember) + { + ArgumentNotNull(enumMember, "enumMember"); + + var valueProperty = enumMember.GetType().GetProperty("Value"); + return valueProperty == null ? null : valueProperty.GetValue(enumMember, null); + } + + public string GetEnumMemberName(MetadataItem enumMember) + { + ArgumentNotNull(enumMember, "enumMember"); + + var nameProperty = enumMember.GetType().GetProperty("Name"); + return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null); + } + + public System.Collections.IEnumerable GetEnumMembers(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + var membersProperty = enumType.GetType().GetProperty("Members"); + return membersProperty != null + ? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null) + : Enumerable.Empty(); + } + + public bool EnumIsFlags(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + var isFlagsProperty = enumType.GetType().GetProperty("IsFlags"); + return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null); + } + + public bool IsEnumType(GlobalItem edmType) + { + ArgumentNotNull(edmType, "edmType"); + + return edmType.GetType().Name == "EnumType"; + } + + public PrimitiveType GetEnumUnderlyingType(EdmType enumType) + { + ArgumentNotNull(enumType, "enumType"); + + return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null); + } + + public string CreateLiteral(object value) + { + if (value == null || value.GetType() != typeof(TimeSpan)) + { + return _code.CreateLiteral(value); + } + + return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks); + } + + public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable types, string sourceFile) + { + ArgumentNotNull(types, "types"); + ArgumentNotNull(sourceFile, "sourceFile"); + + var hash = new HashSet(StringComparer.InvariantCultureIgnoreCase); + if (types.Any(item => !hash.Add(item))) + { + _errors.Add( + new CompilerError(sourceFile, -1, -1, "6023", + String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict")))); + return false; + } + return true; + } + + public IEnumerable GetEnumItemsToGenerate(IEnumerable itemCollection) + { + return GetItemsToGenerate(itemCollection) + .Where(e => IsEnumType(e)); + } + + public IEnumerable GetItemsToGenerate(IEnumerable itemCollection) where T: EdmType + { + return itemCollection + .OfType() + .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName)) + .OrderBy(i => i.Name); + } + + public IEnumerable GetAllGlobalItems(IEnumerable itemCollection) + { + return itemCollection + .Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i)) + .Select(g => GetGlobalItemName(g)); + } + + public string GetGlobalItemName(GlobalItem item) + { + if (item is EdmType) + { + return ((EdmType)item).Name; + } + else + { + return ((EntityContainer)item).Name; + } + } + + public IEnumerable GetSimpleProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetSimpleProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetComplexProperties(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type); + } + + public IEnumerable GetPropertiesWithDefaultValues(EntityType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetPropertiesWithDefaultValues(ComplexType type) + { + return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null); + } + + public IEnumerable GetNavigationProperties(EntityType type) + { + return type.NavigationProperties.Where(np => np.DeclaringType == type); + } + + public IEnumerable GetCollectionNavigationProperties(EntityType type) + { + return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); + } + + public FunctionParameter GetReturnParameter(EdmFunction edmFunction) + { + ArgumentNotNull(edmFunction, "edmFunction"); + + var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters"); + return returnParamsProperty == null + ? edmFunction.ReturnParameter + : ((IEnumerable)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault(); + } + + public bool IsComposable(EdmFunction edmFunction) + { + ArgumentNotNull(edmFunction, "edmFunction"); + + var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute"); + return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null); + } + + public IEnumerable GetParameters(EdmFunction edmFunction) + { + return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef); + } + + public TypeUsage GetReturnType(EdmFunction edmFunction) + { + var returnParam = GetReturnParameter(edmFunction); + return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage); + } + + public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption) + { + var returnType = GetReturnType(edmFunction); + return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType; + } +} + +public static void ArgumentNotNull(T arg, string name) where T : class +{ + if (arg == null) + { + throw new ArgumentNullException(name); + } +} +#> \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityPointStructureEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityPointStructureEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityPointStructureEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,101 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class StabilityPointStructureEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public StabilityPointStructureEntity() + { + StabilityPointStructuresCalculationEntities = new HashSet(); + } + + public long StabilityPointStructureEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public int Order { get; set; } + public string Name { get; set; } + public string Id { get; set; } + public double? X { get; set; } + public double? Y { get; set; } + public double? StructureNormalOrientation { get; set; } + public double? StorageStructureAreaMean { get; set; } + public double? StorageStructureAreaCoefficientOfVariation { get; set; } + public double? AllowedLevelIncreaseStorageMean { get; set; } + public double? AllowedLevelIncreaseStorageStandardDeviation { get; set; } + public double? WidthFlowAperturesMean { get; set; } + public double? WidthFlowAperturesStandardDeviation { get; set; } + public double? InsideWaterLevelMean { get; set; } + public double? InsideWaterLevelStandardDeviation { get; set; } + public double? ThresholdHeightOpenWeirMean { get; set; } + public double? ThresholdHeightOpenWeirStandardDeviation { get; set; } + public double? CriticalOvertoppingDischargeMean { get; set; } + public double? CriticalOvertoppingDischargeCoefficientOfVariation { get; set; } + public double? FlowWidthAtBottomProtectionMean { get; set; } + public double? FlowWidthAtBottomProtectionStandardDeviation { get; set; } + public double? ConstructiveStrengthLinearLoadModelMean { get; set; } + public double? ConstructiveStrengthLinearLoadModelCoefficientOfVariation { get; set; } + public double? ConstructiveStrengthQuadraticLoadModelMean { get; set; } + public double? ConstructiveStrengthQuadraticLoadModelCoefficientOfVariation { get; set; } + public double? BankWidthMean { get; set; } + public double? BankWidthStandardDeviation { get; set; } + public double? InsideWaterLevelFailureConstructionMean { get; set; } + public double? InsideWaterLevelFailureConstructionStandardDeviation { get; set; } + public double? EvaluationLevel { get; set; } + public double? LevelCrestStructureMean { get; set; } + public double? LevelCrestStructureStandardDeviation { get; set; } + public double? VerticalDistance { get; set; } + public double? FailureProbabilityRepairClosure { get; set; } + public double? FailureCollisionEnergyMean { get; set; } + public double? FailureCollisionEnergyCoefficientOfVariation { get; set; } + public double? ShipMassMean { get; set; } + public double? ShipMassCoefficientOfVariation { get; set; } + public double? ShipVelocityMean { get; set; } + public double? ShipVelocityCoefficientOfVariation { get; set; } + public int LevellingCount { get; set; } + public double? ProbabilityCollisionSecondaryStructure { get; set; } + public double? FlowVelocityStructureClosableMean { get; set; } + public double? StabilityLinearLoadModelMean { get; set; } + public double? StabilityLinearLoadModelCoefficientOfVariation { get; set; } + public double? StabilityQuadraticLoadModelMean { get; set; } + public double? StabilityQuadraticLoadModelCoefficientOfVariation { get; set; } + public double? AreaFlowAperturesMean { get; set; } + public double? AreaFlowAperturesStandardDeviation { get; set; } + public byte InflowModelType { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StabilityPointStructuresCalculationEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityPointStructuresCalculationEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityPointStructuresCalculationEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityPointStructuresCalculationEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,121 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public partial class StabilityPointStructuresCalculationEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public StabilityPointStructuresCalculationEntity() + { + StabilityPointStructuresOutputEntities = new HashSet(); + StabilityPointStructuresSectionResultEntities = new HashSet(); + } + + public long StabilityPointStructuresCalculationEntityId { get; set; } + public long CalculationGroupEntityId { get; set; } + public long? ForeshoreProfileEntityId { get; set; } + public long? HydraulicLocationEntityId { get; set; } + public long? StabilityPointStructureEntityId { get; set; } + public int Order { get; set; } + public string Name { get; set; } + public string Comments { get; set; } + public double? InsideWaterLevelMean { get; set; } + public double? InsideWaterLevelStandardDeviation { get; set; } + public double? ThresholdHeightOpenWeirMean { get; set; } + public double? ThresholdHeightOpenWeirStandardDeviation { get; set; } + public double? ConstructiveStrengthLinearLoadModelMean { get; set; } + public double? ConstructiveStrengthLinearLoadModelCoefficientOfVariation { get; set; } + public double? ConstructiveStrengthQuadraticLoadModelMean { get; set; } + public double? ConstructiveStrengthQuadraticLoadModelCoefficientOfVariation { get; set; } + public double? BankWidthMean { get; set; } + public double? BankWidthStandardDeviation { get; set; } + public double? InsideWaterLevelFailureConstructionMean { get; set; } + public double? InsideWaterLevelFailureConstructionStandardDeviation { get; set; } + public double? EvaluationLevel { get; set; } + public double? LevelCrestStructureMean { get; set; } + public double? LevelCrestStructureStandardDeviation { get; set; } + public double? VerticalDistance { get; set; } + public double FailureProbabilityRepairClosure { get; set; } + public double? FailureCollisionEnergyMean { get; set; } + public double? FailureCollisionEnergyCoefficientOfVariation { get; set; } + public double? ShipMassMean { get; set; } + public double? ShipMassCoefficientOfVariation { get; set; } + public double? ShipVelocityMean { get; set; } + public double? ShipVelocityCoefficientOfVariation { get; set; } + public int LevellingCount { get; set; } + public double ProbabilityCollisionSecondaryStructure { get; set; } + public double? FlowVelocityStructureClosableMean { get; set; } + public double? StabilityLinearLoadModelMean { get; set; } + public double? StabilityLinearLoadModelCoefficientOfVariation { get; set; } + public double? StabilityQuadraticLoadModelMean { get; set; } + public double? StabilityQuadraticLoadModelCoefficientOfVariation { get; set; } + public double? AreaFlowAperturesMean { get; set; } + public double? AreaFlowAperturesStandardDeviation { get; set; } + public byte InflowModelType { get; set; } + public byte LoadSchematizationType { get; set; } + public double? VolumicWeightWater { get; set; } + public double? FactorStormDurationOpenStructure { get; set; } + public double? DrainCoefficientMean { get; set; } + + public virtual CalculationGroupEntity CalculationGroupEntity { get; set; } + public virtual StabilityPointStructureEntity StabilityPointStructureEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StabilityPointStructuresOutputEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StabilityPointStructuresSectionResultEntities { get; set; } + + public byte UseBreakWater { get; set; } + public byte BreakWaterType { get; set; } + public double? BreakWaterHeight { get; set; } + public byte UseForeshore { get; set; } + public double? StructureNormalOrientation { get; set; } + public double? StorageStructureAreaMean { get; set; } + public double? StorageStructureAreaCoefficientOfVariation { get; set; } + public double? AllowedLevelIncreaseStorageMean { get; set; } + public double? AllowedLevelIncreaseStorageStandardDeviation { get; set; } + public double? WidthFlowAperturesMean { get; set; } + public double? WidthFlowAperturesStandardDeviation { get; set; } + public double? CriticalOvertoppingDischargeMean { get; set; } + public double? CriticalOvertoppingDischargeCoefficientOfVariation { get; set; } + public double? FlowWidthAtBottomProtectionMean { get; set; } + public double? FlowWidthAtBottomProtectionStandardDeviation { get; set; } + public double? StormDurationMean { get; set; } + public double FailureProbabilityStructureWithErosion { get; set; } + public byte ShouldIllustrationPointsBeCalculated { get; set; } + public virtual ForeshoreProfileEntity ForeshoreProfileEntity { get; set; } + public virtual HydraulicLocationEntity HydraulicLocationEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityPointStructuresFailureMechanismMetaEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityPointStructuresFailureMechanismMetaEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityPointStructuresFailureMechanismMetaEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,43 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class StabilityPointStructuresFailureMechanismMetaEntity + { + public long StabilityPointStructuresFailureMechanismMetaEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public double N { get; set; } + public string ForeshoreProfileCollectionSourcePath { get; set; } + public string StabilityPointStructureCollectionSourcePath { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityPointStructuresOutputEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityPointStructuresOutputEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityPointStructuresOutputEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,43 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public partial class StabilityPointStructuresOutputEntity + { + public long StabilityPointStructuresOutputEntityId { get; set; } + public long StabilityPointStructuresCalculationEntityId { get; set; } + public long? GeneralResultFaultTreeIllustrationPointEntityId { get; set; } + public virtual StabilityPointStructuresCalculationEntity StabilityPointStructuresCalculationEntity { get; set; } + + public virtual GeneralResultFaultTreeIllustrationPointEntity GeneralResultFaultTreeIllustrationPointEntity { get; set; } + public double? Reliability { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityPointStructuresSectionResultEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityPointStructuresSectionResultEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityPointStructuresSectionResultEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,48 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class StabilityPointStructuresSectionResultEntity + { + public long StabilityPointStructuresSectionResultEntityId { get; set; } + public long FailureMechanismSectionEntityId { get; set; } + public long? StabilityPointStructuresCalculationEntityId { get; set; } + public byte SimpleAssessmentResult { get; set; } + public byte DetailedAssessmentResult { get; set; } + public byte TailorMadeAssessmentResult { get; set; } + public double? TailorMadeAssessmentProbability { get; set; } + public byte UseManualAssembly { get; set; } + public double? ManualAssemblyProbability { get; set; } + + public virtual FailureMechanismSectionEntity FailureMechanismSectionEntity { get; set; } + public virtual StabilityPointStructuresCalculationEntity StabilityPointStructuresCalculationEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityStoneCoverFailureMechanismMetaEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityStoneCoverFailureMechanismMetaEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityStoneCoverFailureMechanismMetaEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,42 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class StabilityStoneCoverFailureMechanismMetaEntity + { + public long StabilityStoneCoverFailureMechanismMetaEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public string ForeshoreProfileCollectionSourcePath { get; set; } + public double N { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityStoneCoverSectionResultEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityStoneCoverSectionResultEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityStoneCoverSectionResultEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,49 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class StabilityStoneCoverSectionResultEntity + { + public long StabilityStoneCoverSectionResultEntityId { get; set; } + public long FailureMechanismSectionEntityId { get; set; } + public byte SimpleAssessmentResult { get; set; } + public byte DetailedAssessmentResultForFactorizedSignalingNorm { get; set; } + public byte DetailedAssessmentResultForSignalingNorm { get; set; } + public byte DetailedAssessmentResultForMechanismSpecificLowerLimitNorm { get; set; } + public byte DetailedAssessmentResultForLowerLimitNorm { get; set; } + public byte DetailedAssessmentResultForFactorizedLowerLimitNorm { get; set; } + public byte TailorMadeAssessmentResult { get; set; } + public byte UseManualAssembly { get; set; } + public byte ManualAssemblyCategoryGroup { get; set; } + + public virtual FailureMechanismSectionEntity FailureMechanismSectionEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityStoneCoverWaveConditionsCalculationEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityStoneCoverWaveConditionsCalculationEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityStoneCoverWaveConditionsCalculationEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,70 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class StabilityStoneCoverWaveConditionsCalculationEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public StabilityStoneCoverWaveConditionsCalculationEntity() + { + StabilityStoneCoverWaveConditionsOutputEntities = new HashSet(); + } + + public long StabilityStoneCoverWaveConditionsCalculationEntityId { get; set; } + public long CalculationGroupEntityId { get; set; } + public long? ForeshoreProfileEntityId { get; set; } + public long? HydraulicLocationEntityId { get; set; } + public int Order { get; set; } + public string Name { get; set; } + public string Comments { get; set; } + public byte UseBreakWater { get; set; } + public byte BreakWaterType { get; set; } + public double? BreakWaterHeight { get; set; } + public byte UseForeshore { get; set; } + public double? Orientation { get; set; } + public double? UpperBoundaryRevetment { get; set; } + public double? LowerBoundaryRevetment { get; set; } + public double? UpperBoundaryWaterLevels { get; set; } + public double? LowerBoundaryWaterLevels { get; set; } + public byte StepSize { get; set; } + public byte CategoryType { get; set; } + + public virtual CalculationGroupEntity CalculationGroupEntity { get; set; } + public virtual ForeshoreProfileEntity ForeshoreProfileEntity { get; set; } + public virtual HydraulicLocationEntity HydraulicLocationEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StabilityStoneCoverWaveConditionsOutputEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityStoneCoverWaveConditionsOutputEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityStoneCoverWaveConditionsOutputEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StabilityStoneCoverWaveConditionsOutputEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,52 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class StabilityStoneCoverWaveConditionsOutputEntity + { + public long StabilityStoneCoverWaveConditionsOutputEntityId { get; set; } + public long StabilityStoneCoverWaveConditionsCalculationEntityId { get; set; } + public int Order { get; set; } + public byte OutputType { get; set; } + public double? WaterLevel { get; set; } + public double? WaveHeight { get; set; } + public double? WavePeakPeriod { get; set; } + public double? WaveAngle { get; set; } + public double? WaveDirection { get; set; } + public double? TargetProbability { get; set; } + public double? TargetReliability { get; set; } + public double? CalculatedProbability { get; set; } + public double? CalculatedReliability { get; set; } + public byte CalculationConvergence { get; set; } + + public virtual StabilityStoneCoverWaveConditionsCalculationEntity StabilityStoneCoverWaveConditionsCalculationEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StochastEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StochastEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StochastEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,61 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class StochastEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public StochastEntity() + { + FaultTreeIllustrationPointEntities = new HashSet(); + GeneralResultFaultTreeIllustrationPointEntities = new HashSet(); + GeneralResultSubMechanismIllustrationPointEntities = new HashSet(); + } + + public long StochastEntityId { get; set; } + public string Name { get; set; } + public double Duration { get; set; } + public double Alpha { get; set; } + public int Order { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection FaultTreeIllustrationPointEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GeneralResultFaultTreeIllustrationPointEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection GeneralResultSubMechanismIllustrationPointEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StochasticSoilModelEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StochasticSoilModelEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StochasticSoilModelEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,59 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class StochasticSoilModelEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public StochasticSoilModelEntity() + { + MacroStabilityInwardsStochasticSoilProfileEntities = new HashSet(); + PipingStochasticSoilProfileEntities = new HashSet(); + } + + public long StochasticSoilModelEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public string Name { get; set; } + public string StochasticSoilModelSegmentPointXml { get; set; } + public int Order { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MacroStabilityInwardsStochasticSoilProfileEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection PipingStochasticSoilProfileEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StrengthStabilityLengthwiseConstructionSectionResultEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StrengthStabilityLengthwiseConstructionSectionResultEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/StrengthStabilityLengthwiseConstructionSectionResultEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,44 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class StrengthStabilityLengthwiseConstructionSectionResultEntity + { + public long StrengthStabilityLengthwiseConstructionSectionResultEntityId { get; set; } + public long FailureMechanismSectionEntityId { get; set; } + public byte SimpleAssessmentResult { get; set; } + public byte TailorMadeAssessmentResult { get; set; } + public byte UseManualAssembly { get; set; } + public byte ManualAssemblyCategoryGroup { get; set; } + + public virtual FailureMechanismSectionEntity FailureMechanismSectionEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/SubMechanismIllustrationPointEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/SubMechanismIllustrationPointEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/SubMechanismIllustrationPointEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,64 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class SubMechanismIllustrationPointEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public SubMechanismIllustrationPointEntity() + { + IllustrationPointResultEntities = new HashSet(); + SubMechanismIllustrationPointStochastEntities = new HashSet(); + TopLevelSubMechanismIllustrationPointEntities = new HashSet(); + FaultTreeIllustrationPointEntities = new HashSet(); + } + + public long SubMechanismIllustrationPointEntityId { get; set; } + public string Name { get; set; } + public double Beta { get; set; } + public int Order { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection IllustrationPointResultEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection SubMechanismIllustrationPointStochastEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection TopLevelSubMechanismIllustrationPointEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection FaultTreeIllustrationPointEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/SubMechanismIllustrationPointStochastEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/SubMechanismIllustrationPointStochastEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/SubMechanismIllustrationPointStochastEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,45 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class SubMechanismIllustrationPointStochastEntity + { + public long SubMechanismIllustrationPointStochastEntityId { get; set; } + public long SubMechanismIllustrationPointEntityId { get; set; } + public string Name { get; set; } + public double Duration { get; set; } + public double Alpha { get; set; } + public double Realization { get; set; } + public int Order { get; set; } + + public virtual SubMechanismIllustrationPointEntity SubMechanismIllustrationPointEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/SurfaceLineEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/SurfaceLineEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/SurfaceLineEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,69 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class SurfaceLineEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public SurfaceLineEntity() + { + MacroStabilityInwardsCalculationEntities = new HashSet(); + MacroStabilityInwardsCharacteristicPointEntities = new HashSet(); + PipingCalculationEntities = new HashSet(); + PipingCharacteristicPointEntities = new HashSet(); + } + + public long SurfaceLineEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public string Name { get; set; } + public double? ReferenceLineIntersectionX { get; set; } + public double? ReferenceLineIntersectionY { get; set; } + public string PointsXml { get; set; } + public int Order { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MacroStabilityInwardsCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection MacroStabilityInwardsCharacteristicPointEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection PipingCalculationEntities { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection PipingCharacteristicPointEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/TechnicalInnovationSectionResultEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/TechnicalInnovationSectionResultEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/TechnicalInnovationSectionResultEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,44 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class TechnicalInnovationSectionResultEntity + { + public long TechnicalInnovationSectionResultEntityId { get; set; } + public long FailureMechanismSectionEntityId { get; set; } + public byte SimpleAssessmentResult { get; set; } + public byte TailorMadeAssessmentResult { get; set; } + public byte UseManualAssembly { get; set; } + public byte ManualAssemblyCategoryGroup { get; set; } + + public virtual FailureMechanismSectionEntity FailureMechanismSectionEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/TopLevelFaultTreeIllustrationPointEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/TopLevelFaultTreeIllustrationPointEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/TopLevelFaultTreeIllustrationPointEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,46 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class TopLevelFaultTreeIllustrationPointEntity + { + public long TopLevelFaultTreeIllustrationPointEntityId { get; set; } + public long FaultTreeIllustrationPointEntityId { get; set; } + public long GeneralResultFaultTreeIllustrationPointEntityId { get; set; } + public string ClosingSituation { get; set; } + public string WindDirectionName { get; set; } + public double WindDirectionAngle { get; set; } + public int Order { get; set; } + + public virtual FaultTreeIllustrationPointEntity FaultTreeIllustrationPointEntity { get; set; } + public virtual GeneralResultFaultTreeIllustrationPointEntity GeneralResultFaultTreeIllustrationPointEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/TopLevelSubMechanismIllustrationPointEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/TopLevelSubMechanismIllustrationPointEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/TopLevelSubMechanismIllustrationPointEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,46 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class TopLevelSubMechanismIllustrationPointEntity + { + public long TopLevelSubMechanismIllustrationPointEntityId { get; set; } + public long GeneralResultSubMechanismIllustrationPointEntityId { get; set; } + public long SubMechanismIllustrationPointEntityId { get; set; } + public string ClosingSituation { get; set; } + public string WindDirectionName { get; set; } + public double WindDirectionAngle { get; set; } + public int Order { get; set; } + + public virtual GeneralResultSubMechanismIllustrationPointEntity GeneralResultSubMechanismIllustrationPointEntity { get; set; } + public virtual SubMechanismIllustrationPointEntity SubMechanismIllustrationPointEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/VersionEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/VersionEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/VersionEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,42 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class VersionEntity + { + public long VersionId { get; set; } + public string Version { get; set; } + public DateTime Timestamp { get; set; } + public byte[] FingerPrint { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/WaterPressureAsphaltCoverSectionResultEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/WaterPressureAsphaltCoverSectionResultEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/WaterPressureAsphaltCoverSectionResultEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,44 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class WaterPressureAsphaltCoverSectionResultEntity + { + public long WaterPressureAsphaltCoverSectionResultEntityId { get; set; } + public long FailureMechanismSectionEntityId { get; set; } + public byte SimpleAssessmentResult { get; set; } + public byte TailorMadeAssessmentResult { get; set; } + public byte UseManualAssembly { get; set; } + public byte ManualAssemblyCategoryGroup { get; set; } + + public virtual FailureMechanismSectionEntity FailureMechanismSectionEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/WaveConditionsOutputType.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/WaveConditionsOutputType.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/WaveConditionsOutputType.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,39 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +namespace Ringtoets.Storage.Core.DbContext +{ + /// + /// The type of wave conditions output. + /// + public enum WaveConditionsOutputType + { + /// + /// Corresponds to the wave conditions output for columns. + /// + Columns = 1, + + /// + /// Corresponds to the wave conditions output for blocks. + /// + Blocks = 2 + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/WaveImpactAsphaltCoverFailureMechanismMetaEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/WaveImpactAsphaltCoverFailureMechanismMetaEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/WaveImpactAsphaltCoverFailureMechanismMetaEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,42 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class WaveImpactAsphaltCoverFailureMechanismMetaEntity + { + public long WaveImpactAsphaltCoverFailureMechanismMetaEntityId { get; set; } + public long FailureMechanismEntityId { get; set; } + public string ForeshoreProfileCollectionSourcePath { get; set; } + public double DeltaL { get; set; } + + public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/WaveImpactAsphaltCoverSectionResultEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/WaveImpactAsphaltCoverSectionResultEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/WaveImpactAsphaltCoverSectionResultEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,49 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class WaveImpactAsphaltCoverSectionResultEntity + { + public long WaveImpactAsphaltCoverSectionResultEntityId { get; set; } + public long FailureMechanismSectionEntityId { get; set; } + public byte SimpleAssessmentResult { get; set; } + public byte DetailedAssessmentResultForFactorizedSignalingNorm { get; set; } + public byte DetailedAssessmentResultForSignalingNorm { get; set; } + public byte DetailedAssessmentResultForMechanismSpecificLowerLimitNorm { get; set; } + public byte DetailedAssessmentResultForLowerLimitNorm { get; set; } + public byte DetailedAssessmentResultForFactorizedLowerLimitNorm { get; set; } + public byte TailorMadeAssessmentResult { get; set; } + public byte UseManualAssembly { get; set; } + public byte ManualAssemblyCategoryGroup { get; set; } + + public virtual FailureMechanismSectionEntity FailureMechanismSectionEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/WaveImpactAsphaltCoverWaveConditionsCalculationEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/WaveImpactAsphaltCoverWaveConditionsCalculationEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/WaveImpactAsphaltCoverWaveConditionsCalculationEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,70 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Ringtoets.Storage.Core.DbContext +{ + public class WaveImpactAsphaltCoverWaveConditionsCalculationEntity + { + [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public WaveImpactAsphaltCoverWaveConditionsCalculationEntity() + { + WaveImpactAsphaltCoverWaveConditionsOutputEntities = new HashSet(); + } + + public long WaveImpactAsphaltCoverWaveConditionsCalculationEntityId { get; set; } + public long CalculationGroupEntityId { get; set; } + public long? ForeshoreProfileEntityId { get; set; } + public long? HydraulicLocationEntityId { get; set; } + public int Order { get; set; } + public string Name { get; set; } + public string Comments { get; set; } + public byte UseBreakWater { get; set; } + public byte BreakWaterType { get; set; } + public double? BreakWaterHeight { get; set; } + public byte UseForeshore { get; set; } + public double? Orientation { get; set; } + public double? UpperBoundaryRevetment { get; set; } + public double? LowerBoundaryRevetment { get; set; } + public double? UpperBoundaryWaterLevels { get; set; } + public double? LowerBoundaryWaterLevels { get; set; } + public byte StepSize { get; set; } + public byte CategoryType { get; set; } + + public virtual CalculationGroupEntity CalculationGroupEntity { get; set; } + public virtual ForeshoreProfileEntity ForeshoreProfileEntity { get; set; } + public virtual HydraulicLocationEntity HydraulicLocationEntity { get; set; } + + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection WaveImpactAsphaltCoverWaveConditionsOutputEntities { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/WaveImpactAsphaltCoverWaveConditionsOutputEntity.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/WaveImpactAsphaltCoverWaveConditionsOutputEntity.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DbContext/WaveImpactAsphaltCoverWaveConditionsOutputEntity.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,51 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.DbContext +{ + public class WaveImpactAsphaltCoverWaveConditionsOutputEntity + { + public long WaveImpactAsphaltCoverWaveConditionsOutputEntityId { get; set; } + public long WaveImpactAsphaltCoverWaveConditionsCalculationEntityId { get; set; } + public int Order { get; set; } + public double? WaterLevel { get; set; } + public double? WaveHeight { get; set; } + public double? WavePeakPeriod { get; set; } + public double? WaveAngle { get; set; } + public double? WaveDirection { get; set; } + public double? TargetProbability { get; set; } + public double? TargetReliability { get; set; } + public double? CalculatedProbability { get; set; } + public double? CalculatedReliability { get; set; } + public byte CalculationConvergence { get; set; } + + public virtual WaveImpactAsphaltCoverWaveConditionsCalculationEntity WaveImpactAsphaltCoverWaveConditionsCalculationEntity { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/DoubleConversionExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/DoubleConversionExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/DoubleConversionExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,66 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; + +namespace Ringtoets.Storage.Core +{ + /// + /// Class that contains extension methods for to convert them to + /// other value types. + /// + public static class DoubleConversionExtensions + { + /// + /// Converts a to a . If + /// is , the result is null. + /// + /// The value to convert. + /// null if is , the value + /// of otherwise. + public static double? ToNaNAsNull(this double value) + { + if (double.IsNaN(value)) + { + return null; + } + + return value; + } + + /// + /// Converts a to a . If + /// is null, the result is . + /// + /// The value to convert. + /// if is null, the value + /// of otherwise. + public static double ToNullAsNaN(this double? value) + { + if (value == null) + { + return double.NaN; + } + + return value.Value; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Exceptions/CannotDeleteBackupFileException.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Exceptions/CannotDeleteBackupFileException.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Exceptions/CannotDeleteBackupFileException.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,68 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Runtime.Serialization; + +namespace Ringtoets.Storage.Core.Exceptions +{ + /// + /// The exception that is thrown when the original file cannot be restored by . + /// + [Serializable] + public class CannotDeleteBackupFileException : Exception + { + /// + /// Initializes a new instance of the class. + /// + public CannotDeleteBackupFileException() {} + + /// + /// Initializes a new instance of the class + /// with a specified error message. + /// + /// The error message that explains the reason for the exception. + public CannotDeleteBackupFileException(string message) : base(message) {} + + /// + /// Initializes a new instance of the class + /// with a specified error message and a reference to the inner exception that is + /// the cause of this exception. + /// + /// The error message that explains the reason for the exception. + /// The exception that is the cause of the current exception, + /// or null if no inner exception is specified. + public CannotDeleteBackupFileException(string message, Exception inner) : base(message, inner) {} + + /// + /// Initializes a new instance of with + /// serialized data. + /// The that holds the serialized + /// object data about the exception being thrown. + /// The that contains contextual + /// information about the source or destination. + /// The parameter is + /// null. + /// The class name is null or + /// is zero (0). + protected CannotDeleteBackupFileException(SerializationInfo info, StreamingContext context) : base(info, context) {} + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Exceptions/CannotDetermineFingerprintException.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Exceptions/CannotDetermineFingerprintException.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Exceptions/CannotDetermineFingerprintException.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,69 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Runtime.Serialization; + +namespace Ringtoets.Storage.Core.Exceptions +{ + /// + /// The exception that is thrown when is unable to + /// create a fingerprint. + /// + [Serializable] + public class CannotDetermineFingerprintException : Exception + { + /// + /// Initializes a new instance of the class. + /// + public CannotDetermineFingerprintException() {} + + /// + /// Initializes a new instance of the class + /// with a specified error message. + /// + /// The error message that explains the reason for the exception. + public CannotDetermineFingerprintException(string message) : base(message) {} + + /// + /// Initializes a new instance of the class + /// with a specified error message and a reference to the inner exception that is + /// the cause of this exception. + /// + /// The error message that explains the reason for the exception. + /// The exception that is the cause of the current exception, + /// or null if no inner exception is specified. + public CannotDetermineFingerprintException(string message, Exception inner) : base(message, inner) {} + + /// + /// Initializes a new instance of with + /// serialized data. + /// The that holds the serialized + /// object data about the exception being thrown. + /// The that contains contextual + /// information about the source or destination. + /// The parameter is + /// null. + /// The class name is null or + /// is zero (0). + protected CannotDetermineFingerprintException(SerializationInfo info, StreamingContext context) : base(info, context) {} + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Exceptions/EntityNotFoundException.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Exceptions/EntityNotFoundException.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Exceptions/EntityNotFoundException.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,68 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Runtime.Serialization; + +namespace Ringtoets.Storage.Core.Exceptions +{ + /// + /// The exception that is thrown when an entity is not found. + /// + [Serializable] + public class EntityNotFoundException : Exception + { + /// + /// Initializes a new instance of the class. + /// + public EntityNotFoundException() {} + + /// + /// Initializes a new instance of the class + /// with a specified error message. + /// + /// The error message that explains the reason for the exception. + public EntityNotFoundException(string message) : base(message) {} + + /// + /// Initializes a new instance of the class + /// with a specified error message and a reference to the inner exception that is + /// the cause of this exception. + /// + /// The error message that explains the reason for the exception. + /// The exception that is the cause of the current exception, + /// or null if no inner exception is specified. + public EntityNotFoundException(string message, Exception inner) : base(message, inner) {} + + /// + /// Initializes a new instance of with + /// serialized data. + /// The that holds the serialized + /// object data about the exception being thrown. + /// The that contains contextual + /// information about the source or destination. + /// The parameter is + /// null. + /// The class name is null or + /// is zero (0). + protected EntityNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) {} + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/FingerprintHelper.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/FingerprintHelper.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/FingerprintHelper.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,127 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.IO; +using System.Linq; +using System.Runtime.Serialization; +using System.Security.Cryptography; +using System.ServiceModel; +using System.Xml; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Exceptions; +using Ringtoets.Storage.Core.Properties; + +namespace Ringtoets.Storage.Core +{ + /// + /// This class is capable of generating a hashcode for serializable object instance + /// such that the hashcode can be used to detect changes. + /// + public static class FingerprintHelper + { + /// + /// Gets the fingerprint for the given . + /// + /// The to generate a hashcode for. + /// The binary hashcode for . + /// Thrown when is null. + /// Thrown when a critical + /// error occurs when trying to determine the fingerprint. + public static byte[] Get(ProjectEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + string filePath = Path.GetTempFileName(); + + byte[] computeHash = ComputeHash(entity, filePath); + + File.Delete(filePath); + + return computeHash; + } + catch (Exception e) when (e is UnauthorizedAccessException || e is IOException || e is QuotaExceededException) + { + throw new CannotDetermineFingerprintException(Resources.FingerprintHelper_Critical_error_message, e); + } + } + + /// + /// Determines if two fingerprint byte arrays are equal to each other. + /// + /// The first array, cannot be null. + /// The second array, cannot be null. + /// true if the two fingerprints are equal, false otherwise. + public static bool AreEqual(byte[] array1, byte[] array2) + { + if (array1.Length != array2.Length) + { + return false; + } + + // Note: Do not turn this into a linq query, as that is less performance optimal! + for (var i = 0; i < array1.Length; i++) + { + if (!array1[i].Equals(array2[i])) + { + return false; + } + } + + return true; + } + + /// + /// While using a target file as storage, determines the fingerprint for the given + /// . + /// + /// The to generate a hashcode for. + /// The filepath to use as temporary storage. + /// The binary hashcode for . + /// Thrown when is null. + /// Thrown when + /// contains more than unique object instances. + /// The caller does not have the + /// required permissions or is read-only. + /// An I/O exception occurred while creating the file + /// at . + private static byte[] ComputeHash(ProjectEntity entity, string filePath) + { + using (HashAlgorithm hashingAlgorithm = MD5.Create()) + using (FileStream stream = File.Create(filePath)) + using (XmlDictionaryWriter writer = XmlDictionaryWriter.CreateBinaryWriter(stream)) + { + var serializer = new DataContractSerializer(entity.GetType(), + Enumerable.Empty(), + int.MaxValue, false, true, null); + serializer.WriteObject(writer, entity); + writer.Flush(); + stream.Seek(0, SeekOrigin.Begin); + return hashingAlgorithm.ComputeHash(stream); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Properties/AssemblyInfo.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Properties/AssemblyInfo.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Properties/AssemblyInfo.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,29 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Reflection; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("Riskeer.Storage.Core")] +[assembly: AssemblyProduct("Riskeer.Storage.Core")] +[assembly: InternalsVisibleTo("Ringtoets.Storage.Core.Test")] +[assembly: InternalsVisibleTo("Ringtoets.Storage.Core.TestUtil")] +[assembly: InternalsVisibleTo("Ringtoets.Storage.Core.TestUtil.Test")] \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Properties/Resources.Designer.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Properties/Resources.Designer.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Properties/Resources.Designer.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,245 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Storage.Core.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Ringtoets.Storage.Core.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to /* ---------------------------------------------------- */ + ////* Generated by Enterprise Architect Version 12.0 */ + ////* Created On : 31-May-2018 13:40:52 */ + ////* DBMS : SQLite */ + ////* ---------------------------------------------------- */ + /// + ////* Drop Tables */ + /// + ///DROP TABLE IF EXISTS 'VersionEntity' + ///; + /// + ///DROP TABLE IF EXISTS 'GrassCoverErosionInwardsDikeHeightOutputEntity' + ///; + /// + ///DROP TABLE IF EXISTS 'ProjectEntity' + ///; + /// + ///DROP TABLE IF EXISTS 'MacroStabilityInwardsFailureMechanismMetaEntity' + ///; + /// + ///DROP TABLE [rest of string was truncated]";. + /// + public static string DatabaseStructure { + get { + return ResourceManager.GetString("DatabaseStructure", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Er is een fout opgetreden in de verbinding met het Ringtoets bestand.. + /// + public static string Error_during_connection { + get { + return ResourceManager.GetString("Error_during_connection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Een fout is opgetreden tijdens het opslaan van het Ringtoets bestand.. + /// + public static string Error_saving_database { + get { + return ResourceManager.GetString("Error_saving_database", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Een fout is opgetreden met schrijven naar het nieuwe Ringtoets bestand.. + /// + public static string Error_writing_structure_to_database { + get { + return ResourceManager.GetString("Error_writing_structure_to_database", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Een kritieke fout voorkomt dat een vingerafdruk van de projectdata gemaakt kan worden.. + /// + public static string FingerprintHelper_Critical_error_message { + get { + return ResourceManager.GetString("FingerprintHelper_Critical_error_message", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ringtoetsproject (*.rtd)|*.rtd. + /// + public static string Ringtoets_project_file_filter { + get { + return ResourceManager.GetString("Ringtoets_project_file_filter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kan geen tijdelijk bestand maken van het originele bestand ({0}).. + /// + public static string SafeOverwriteFileHelper_CreateNewTemporaryFile_Cannot_create_temporary_FilePath_0_Try_change_save_location { + get { + return ResourceManager.GetString("SafeOverwriteFileHelper_CreateNewTemporaryFile_Cannot_create_temporary_FilePath_0" + + "_Try_change_save_location", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kan het tijdelijke bestand ({0}) niet opruimen. Het tijdelijke bestand dient handmatig verwijderd te worden.. + /// + public static string SafeOverwriteFileHelper_DeleteTemporaryFile_Cannot_remove_temporary_FilePath_0_Try_removing_manually { + get { + return ResourceManager.GetString("SafeOverwriteFileHelper_DeleteTemporaryFile_Cannot_remove_temporary_FilePath_0_Tr" + + "y_removing_manually", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Er bestaat al een tijdelijk bestand ({0}) dat niet verwijderd kan worden. Dit bestand dient handmatig verwijderd te worden.. + /// + public static string SafeOverwriteFileHelper_RemoveAlreadyExistingTemporaryFile_Already_existing_temporary_file_at_FilePath_0_could_not_be_removed { + get { + return ResourceManager.GetString("SafeOverwriteFileHelper_RemoveAlreadyExistingTemporaryFile_Already_existing_tempo" + + "rary_file_at_FilePath_0_could_not_be_removed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kan het originele bestand ({0}) niet herstellen. Het tijdelijke bestand dient handmatig hersteld te worden.. + /// + public static string SafeOverwriteFileHelper_RestoreOriginalFile_Cannot_revert_to_original_FilePath_0_Try_reverting_manually { + get { + return ResourceManager.GetString("SafeOverwriteFileHelper_RestoreOriginalFile_Cannot_revert_to_original_FilePath_0_" + + "Try_reverting_manually", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Het project bevat te veel unieke objecten om een digitale vingerafdruk van te genereren.. + /// + public static string StorageSqLite_HasStagedProjectChanges_Project_contains_too_many_objects_to_generate_fingerprint { + get { + return ResourceManager.GetString("StorageSqLite_HasStagedProjectChanges_Project_contains_too_many_objects_to_genera" + + "te_fingerprint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Het bestand is geen geldig Ringtoets bestand.. + /// + public static string StorageSqLite_LoadProject_Invalid_Ringtoets_database_file { + get { + return ResourceManager.GetString("StorageSqLite_LoadProject_Invalid_Ringtoets_database_file", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Database moet één rij in de VersionEntity tabel hebben.. + /// + public static string StorageSqLite_ValidateDatabaseVersion_Database_must_have_one_VersionEntity_row { + get { + return ResourceManager.GetString("StorageSqLite_ValidateDatabaseVersion_Database_must_have_one_VersionEntity_row", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ringtoets bestand versie '{0}' is hoger dan de huidig ondersteunde versie ('{1}'). Update Ringtoets naar een nieuwere versie.. + /// + public static string StorageSqLite_ValidateDatabaseVersion_DatabaseVersion_0_higher_then_current_DatabaseVersion_1_ { + get { + return ResourceManager.GetString("StorageSqLite_ValidateDatabaseVersion_DatabaseVersion_0_higher_then_current_Datab" + + "aseVersion_1_", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ringtoets bestand versie '{0}' is niet valide. De versie van het Ringtoets projectbestand dient '16.4' of hoger te zijn.. + /// + public static string StorageSqLite_ValidateDatabaseVersion_DatabaseVersion_0_is_invalid { + get { + return ResourceManager.GetString("StorageSqLite_ValidateDatabaseVersion_DatabaseVersion_0_is_invalid", resourceCulture); + } + } + } +} Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Properties/Resources.resx =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Properties/Resources.resx (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Properties/Resources.resx (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Er is een fout opgetreden in de verbinding met het Ringtoets bestand. + + + Een fout is opgetreden tijdens het opslaan van het Ringtoets bestand. + + + Een fout is opgetreden met schrijven naar het nieuwe Ringtoets bestand. + + + Ringtoetsproject (*.rtd)|*.rtd + + + Het bestand is geen geldig Ringtoets bestand. + + + Kan geen tijdelijk bestand maken van het originele bestand ({0}). + + + Kan het originele bestand ({0}) niet herstellen. Het tijdelijke bestand dient handmatig hersteld te worden. + + + Kan het tijdelijke bestand ({0}) niet opruimen. Het tijdelijke bestand dient handmatig verwijderd te worden. + + + Er bestaat al een tijdelijk bestand ({0}) dat niet verwijderd kan worden. Dit bestand dient handmatig verwijderd te worden. + + + Ringtoets bestand versie '{0}' is niet valide. De versie van het Ringtoets projectbestand dient '16.4' of hoger te zijn. + + + Ringtoets bestand versie '{0}' is hoger dan de huidig ondersteunde versie ('{1}'). Update Ringtoets naar een nieuwere versie. + + + Database moet één rij in de VersionEntity tabel hebben. + + + Het project bevat te veel unieke objecten om een digitale vingerafdruk van te genereren. + + + + ..\..\..\..\..\build\databasestructure.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + + Een kritieke fout voorkomt dat een vingerafdruk van de projectdata gemaakt kan worden. + + \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/AssessmentSectionEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/AssessmentSectionEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/AssessmentSectionEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,265 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Linq; +using Core.Common.Base.Geometry; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.Contribution; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Integration.Data; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Serializers; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// This class defines extension methods for read operations for an based on the + /// . + /// + internal static class AssessmentSectionEntityReadExtensions + { + /// + /// Read the and use the information to construct a . + /// + /// The to create for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + internal static AssessmentSection Read(this AssessmentSectionEntity entity, ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + var assessmentSection = new AssessmentSection((AssessmentSectionComposition) entity.Composition, + entity.LowerLimitNorm, + entity.SignalingNorm) + { + Id = entity.Id, + Name = entity.Name, + Comments = + { + Body = entity.Comments + }, + FailureMechanismContribution = + { + NormativeNorm = (NormType) entity.NormativeNormType + } + }; + + entity.ReadBackgroundData(assessmentSection); + + entity.ReadHydraulicDatabase(assessmentSection, collector); + entity.ReadReferenceLine(assessmentSection); + + entity.ReadPipingFailureMechanism(assessmentSection, collector); + entity.ReadGrassCoverErosionInwardsFailureMechanism(assessmentSection, collector); + entity.ReadHeightStructuresFailureMechanism(assessmentSection, collector); + entity.ReadStrengthStabilityLengthwiseConstructionFailureMechanism(assessmentSection, collector); + entity.ReadTechnicalInnovationFailureMechanism(assessmentSection, collector); + entity.ReadWaterPressureAsphaltCoverFailureMechanism(assessmentSection, collector); + entity.ReadClosingStructuresFailureMechanism(assessmentSection, collector); + entity.ReadMacroStabilityInwardsFailureMechanism(assessmentSection, collector); + entity.ReadMacroStabilityOutwardsFailureMechanism(assessmentSection, collector); + entity.ReadWaveImpactAsphaltCoverFailureMechanism(assessmentSection, collector); + entity.ReadGrassCoverErosionOutwardsFailureMechanism(assessmentSection, collector); + entity.ReadGrassCoverSlipOffInwardsFailureMechanism(assessmentSection, collector); + entity.ReadGrassCoverSlipOffOutwardsFailureMechanism(assessmentSection, collector); + entity.ReadMicrostabilityFailureMechanism(assessmentSection, collector); + entity.ReadPipingStructureFailureMechanism(assessmentSection, collector); + entity.ReadDuneErosionFailureMechanism(assessmentSection, collector); + entity.ReadStabilityStoneCoverFailureMechanism(assessmentSection, collector); + entity.ReadStabilityPointStructuresFailureMechanism(assessmentSection, collector); + + return assessmentSection; + } + + private static void ReadBackgroundData(this AssessmentSectionEntity entity, IAssessmentSection assessmentSection) + { + BackgroundData readBackgroundData = entity.BackgroundDataEntities.Single().Read(); + + BackgroundData backgroundData = assessmentSection.BackgroundData; + backgroundData.IsVisible = readBackgroundData.IsVisible; + backgroundData.Transparency = readBackgroundData.Transparency; + backgroundData.Name = readBackgroundData.Name; + backgroundData.Configuration = readBackgroundData.Configuration; + } + + private static void ReadReferenceLine(this AssessmentSectionEntity entity, IAssessmentSection assessmentSection) + { + if (entity.ReferenceLinePointXml != null) + { + Point2D[] points = new Point2DCollectionXmlSerializer().FromXml(entity.ReferenceLinePointXml); + assessmentSection.ReferenceLine.SetGeometry(points); + } + } + + private static void ReadHydraulicDatabase(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) + { + HydraulicBoundaryDatabaseEntity hydraulicBoundaryDatabaseEntity = entity.HydraulicBoundaryDatabaseEntities.SingleOrDefault(); + if (hydraulicBoundaryDatabaseEntity != null) + { + HydraulicBoundaryDatabase hydraulicBoundaryDatabase = assessmentSection.HydraulicBoundaryDatabase; + hydraulicBoundaryDatabaseEntity.Read(hydraulicBoundaryDatabase); + + HydraulicBoundaryLocation[] readHydraulicBoundaryLocations = entity.HydraulicLocationEntities + .OrderBy(hl => hl.Order) + .Select(hle => hle.Read(collector)) + .ToArray(); + hydraulicBoundaryDatabase.Locations.AddRange(readHydraulicBoundaryLocations); + assessmentSection.SetHydraulicBoundaryLocationCalculations(readHydraulicBoundaryLocations); + assessmentSection.GrassCoverErosionOutwards.SetHydraulicBoundaryLocationCalculations(readHydraulicBoundaryLocations); + + entity.ReadHydraulicBoundaryLocationCalculations(assessmentSection, collector); + } + } + + private static void ReadHydraulicBoundaryLocationCalculations(this AssessmentSectionEntity entity, + IAssessmentSection assessmentSection, + ReadConversionCollector collector) + { + entity.HydraulicLocationCalculationCollectionEntity7.Read(assessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm, collector); + entity.HydraulicLocationCalculationCollectionEntity6.Read(assessmentSection.WaterLevelCalculationsForSignalingNorm, collector); + entity.HydraulicLocationCalculationCollectionEntity5.Read(assessmentSection.WaterLevelCalculationsForLowerLimitNorm, collector); + entity.HydraulicLocationCalculationCollectionEntity4.Read(assessmentSection.WaterLevelCalculationsForFactorizedLowerLimitNorm, collector); + + entity.HydraulicLocationCalculationCollectionEntity3.Read(assessmentSection.WaveHeightCalculationsForFactorizedSignalingNorm, collector); + entity.HydraulicLocationCalculationCollectionEntity2.Read(assessmentSection.WaveHeightCalculationsForSignalingNorm, collector); + entity.HydraulicLocationCalculationCollectionEntity1.Read(assessmentSection.WaveHeightCalculationsForLowerLimitNorm, collector); + entity.HydraulicLocationCalculationCollectionEntity.Read(assessmentSection.WaveHeightCalculationsForFactorizedLowerLimitNorm, collector); + } + + private static void ReadPipingFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) + { + FailureMechanismEntity pipingFailureMechanismEntity = GetFailureMechanismEntityOfType(entity, FailureMechanismType.Piping); + pipingFailureMechanismEntity?.ReadAsPipingFailureMechanism(assessmentSection.Piping, collector); + } + + private static void ReadGrassCoverErosionInwardsFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) + { + FailureMechanismEntity grassCoverErosionInwardsFailureMechanismEntity = GetFailureMechanismEntityOfType(entity, FailureMechanismType.GrassRevetmentTopErosionAndInwards); + grassCoverErosionInwardsFailureMechanismEntity?.ReadAsGrassCoverErosionInwardsFailureMechanism(assessmentSection.GrassCoverErosionInwards, collector); + } + + private static void ReadHeightStructuresFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) + { + FailureMechanismEntity heightStructuresFailureMechanismEntity = GetFailureMechanismEntityOfType(entity, FailureMechanismType.StructureHeight); + heightStructuresFailureMechanismEntity?.ReadAsHeightStructuresFailureMechanism(assessmentSection.HeightStructures, collector); + } + + private static void ReadStrengthStabilityLengthwiseConstructionFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) + { + FailureMechanismEntity strengthStabilityLengthwiseConstructionFailureMechanismEntity = GetFailureMechanismEntityOfType(entity, FailureMechanismType.StrengthAndStabilityParallelConstruction); + strengthStabilityLengthwiseConstructionFailureMechanismEntity?.ReadAsStrengthStabilityLengthwiseConstructionFailureMechanism(assessmentSection.StrengthStabilityLengthwiseConstruction, collector); + } + + private static void ReadTechnicalInnovationFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) + { + FailureMechanismEntity technicalInnovationFailureMechanismEntity = GetFailureMechanismEntityOfType(entity, FailureMechanismType.TechnicalInnovations); + technicalInnovationFailureMechanismEntity?.ReadAsTechnicalInnovationFailureMechanism(assessmentSection.TechnicalInnovation, collector); + } + + private static void ReadWaterPressureAsphaltCoverFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) + { + FailureMechanismEntity waterPressureAsphaltCoverFailureMechanismEntity = GetFailureMechanismEntityOfType(entity, FailureMechanismType.WaterOverpressureAsphaltRevetment); + waterPressureAsphaltCoverFailureMechanismEntity?.ReadAsWaterPressureAsphaltCoverFailureMechanism(assessmentSection.WaterPressureAsphaltCover, collector); + } + + private static void ReadClosingStructuresFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) + { + FailureMechanismEntity closingStructuresFailureMechanismEntity = GetFailureMechanismEntityOfType(entity, FailureMechanismType.ReliabilityClosingOfStructure); + closingStructuresFailureMechanismEntity?.ReadAsClosingStructuresFailureMechanism(assessmentSection.ClosingStructures, collector); + } + + private static void ReadMacroStabilityInwardsFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) + { + FailureMechanismEntity macroStabilityInwardsFailureMechanismEntity = GetFailureMechanismEntityOfType(entity, FailureMechanismType.MacroStabilityInwards); + macroStabilityInwardsFailureMechanismEntity?.ReadAsMacroStabilityInwardsFailureMechanism(assessmentSection.MacroStabilityInwards, collector); + } + + private static void ReadMacroStabilityOutwardsFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) + { + FailureMechanismEntity macroStabilityOutwardsFailureMechanismEntity = GetFailureMechanismEntityOfType(entity, FailureMechanismType.MacroStabilityOutwards); + macroStabilityOutwardsFailureMechanismEntity?.ReadAsMacroStabilityOutwardsFailureMechanism(assessmentSection.MacroStabilityOutwards, collector); + } + + private static void ReadWaveImpactAsphaltCoverFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) + { + FailureMechanismEntity waveImpactAsphaltCoverFailureMechanismEntity = GetFailureMechanismEntityOfType(entity, FailureMechanismType.WaveImpactOnAsphaltRevetment); + waveImpactAsphaltCoverFailureMechanismEntity?.ReadAsWaveImpactAsphaltCoverFailureMechanism(assessmentSection.WaveImpactAsphaltCover, collector); + } + + private static void ReadGrassCoverErosionOutwardsFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) + { + FailureMechanismEntity grassCoverErosionOutwardsFailureMechanismEntity = GetFailureMechanismEntityOfType(entity, FailureMechanismType.GrassRevetmentErosionOutwards); + grassCoverErosionOutwardsFailureMechanismEntity?.ReadAsGrassCoverErosionOutwardsFailureMechanism(assessmentSection.GrassCoverErosionOutwards, collector); + } + + private static void ReadGrassCoverSlipOffInwardsFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) + { + FailureMechanismEntity grassCoverSlipOffInwardsFailureMechanismEntity = GetFailureMechanismEntityOfType(entity, FailureMechanismType.GrassRevetmentSlidingInwards); + grassCoverSlipOffInwardsFailureMechanismEntity?.ReadAsGrassCoverSlipOffInwardsFailureMechanism(assessmentSection.GrassCoverSlipOffInwards, collector); + } + + private static void ReadGrassCoverSlipOffOutwardsFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) + { + FailureMechanismEntity grassCoverSlipOffOutwardsFailureMechanismEntity = GetFailureMechanismEntityOfType(entity, FailureMechanismType.GrassRevetmentSlidingOutwards); + grassCoverSlipOffOutwardsFailureMechanismEntity?.ReadAsGrassCoverSlipOffOutwardsFailureMechanism(assessmentSection.GrassCoverSlipOffOutwards, collector); + } + + private static void ReadMicrostabilityFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) + { + FailureMechanismEntity microstabilityFailureMechanismEntity = GetFailureMechanismEntityOfType(entity, FailureMechanismType.Microstability); + microstabilityFailureMechanismEntity?.ReadAsMicrostabilityFailureMechanism(assessmentSection.Microstability, collector); + } + + private static void ReadPipingStructureFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) + { + FailureMechanismEntity pipingStructureFailureMechanismEntity = GetFailureMechanismEntityOfType(entity, FailureMechanismType.PipingAtStructure); + pipingStructureFailureMechanismEntity?.ReadAsPipingStructureFailureMechanism(assessmentSection.PipingStructure, collector); + } + + private static void ReadDuneErosionFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) + { + FailureMechanismEntity duneErosionFailureMechanismEntity = GetFailureMechanismEntityOfType(entity, FailureMechanismType.DuneErosion); + duneErosionFailureMechanismEntity?.ReadAsDuneErosionFailureMechanism(assessmentSection.DuneErosion, collector); + } + + private static void ReadStabilityStoneCoverFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) + { + FailureMechanismEntity stabilityStoneCoverFailureMechanismEntity = GetFailureMechanismEntityOfType(entity, FailureMechanismType.StabilityStoneRevetment); + stabilityStoneCoverFailureMechanismEntity?.ReadAsStabilityStoneCoverFailureMechanism(assessmentSection.StabilityStoneCover, collector); + } + + private static void ReadStabilityPointStructuresFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) + { + FailureMechanismEntity stabilityPointStructuresFailureMechanismEntity = GetFailureMechanismEntityOfType(entity, FailureMechanismType.StabilityPointStructures); + stabilityPointStructuresFailureMechanismEntity?.ReadAsStabilityPointStructuresFailureMechanism(assessmentSection.StabilityPointStructures, collector); + } + + private static FailureMechanismEntity GetFailureMechanismEntityOfType(AssessmentSectionEntity entity, FailureMechanismType type) + { + return entity.FailureMechanismEntities.SingleOrDefault(fme => fme.FailureMechanismType == (int) type); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/BackgroundDataEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/BackgroundDataEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/BackgroundDataEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,121 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using Core.Common.Base.Data; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// Extension methods for read operations for + /// based on the . + /// + internal static class BackgroundDataEntityReadExtensions + { + /// + /// Read the and use the information + /// to construct . + /// + /// The + /// to create for. + /// A new . + /// Thrown when + /// is null. + internal static BackgroundData Read(this BackgroundDataEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + IBackgroundDataConfiguration configuration = null; + + if ((BackgroundDataType) entity.BackgroundDataType == BackgroundDataType.Wmts) + { + configuration = ReadWmtsConfiguration(entity.BackgroundDataMetaEntities); + } + else if ((BackgroundDataType) entity.BackgroundDataType == BackgroundDataType.WellKnown) + { + configuration = ReadWellKnownConfiguration(entity.BackgroundDataMetaEntities); + } + + var backgroundData = new BackgroundData(configuration) + { + IsVisible = Convert.ToBoolean(entity.IsVisible), + Transparency = (RoundedDouble) entity.Transparency, + Name = entity.Name + }; + + return backgroundData; + } + + private static IBackgroundDataConfiguration ReadWmtsConfiguration(IEnumerable backgroundDataMetaEntities) + { + string sourceCapabilitiesUrl = null; + string selectedCapabilityIdentifier = null; + string preferredFormat = null; + + bool isConfigured = Convert.ToBoolean(Convert.ToInt16(backgroundDataMetaEntities + .Single(entity => entity.Key.Equals(BackgroundDataIdentifiers.IsConfigured)) + .Read().Value)); + + if (isConfigured) + { + foreach (BackgroundDataMetaEntity backgroundDataMetaEntity in backgroundDataMetaEntities) + { + if (backgroundDataMetaEntity.Key.Equals(BackgroundDataIdentifiers.SourceCapabilitiesUrl)) + { + sourceCapabilitiesUrl = backgroundDataMetaEntity.Read().Value; + } + + if (backgroundDataMetaEntity.Key.Equals(BackgroundDataIdentifiers.SelectedCapabilityIdentifier)) + { + selectedCapabilityIdentifier = backgroundDataMetaEntity.Read().Value; + } + + if (backgroundDataMetaEntity.Key.Equals(BackgroundDataIdentifiers.PreferredFormat)) + { + preferredFormat = backgroundDataMetaEntity.Read().Value; + } + } + } + + return new WmtsBackgroundDataConfiguration(isConfigured, + sourceCapabilitiesUrl, + selectedCapabilityIdentifier, + preferredFormat); + } + + private static IBackgroundDataConfiguration ReadWellKnownConfiguration(IEnumerable backgroundDataMetaEntities) + { + KeyValuePair parameter = + backgroundDataMetaEntities.Single(metaEntity => metaEntity.Key.Equals(BackgroundDataIdentifiers.WellKnownTileSource)) + .Read(); + + var wellKnownTileSource = (RingtoetsWellKnownTileSource) Convert.ToInt32(parameter.Value); + return new WellKnownBackgroundDataConfiguration(wellKnownTileSource); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/BackgroundDataMetaEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/BackgroundDataMetaEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/BackgroundDataMetaEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,52 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// Extensions methods for read operations based on the . + /// + internal static class BackgroundDataMetaEntityReadExtensions + { + /// + /// Read the and use the information + /// to construct a . + /// + /// The + /// to create for. + /// A new . + /// Thrown when + /// is null. + internal static KeyValuePair Read(this BackgroundDataMetaEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return new KeyValuePair(entity.Key, entity.Value); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/CalculationGroupEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/CalculationGroupEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/CalculationGroupEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,468 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections; +using Ringtoets.Common.Data.Calculation; +using Ringtoets.Piping.Data; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Read.ClosingStructures; +using Ringtoets.Storage.Core.Read.GrassCoverErosionInwards; +using Ringtoets.Storage.Core.Read.GrassCoverErosionOutwards; +using Ringtoets.Storage.Core.Read.HeightStructures; +using Ringtoets.Storage.Core.Read.MacroStabilityInwards; +using Ringtoets.Storage.Core.Read.Piping; +using Ringtoets.Storage.Core.Read.StabilityPointStructures; +using Ringtoets.Storage.Core.Read.StabilityStoneCover; +using Ringtoets.Storage.Core.Read.WaveImpactAsphaltCover; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class CalculationGroupEntityReadExtensions + { + /// + /// Read the and use the information to construct + /// a . + /// + /// The to create + /// for. + /// The object keeping track of read operations. + /// The calculation input parameters for piping. + /// A new . + /// Thrown when + /// or is null. + internal static CalculationGroup ReadAsPipingCalculationGroup(this CalculationGroupEntity entity, ReadConversionCollector collector, + GeneralPipingInput generalPipingInput) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (generalPipingInput == null) + { + throw new ArgumentNullException(nameof(generalPipingInput)); + } + + var group = new CalculationGroup + { + Name = entity.Name + }; + + foreach (object childEntity in GetChildEntitiesInOrder(entity)) + { + var childCalculationGroupEntity = childEntity as CalculationGroupEntity; + if (childCalculationGroupEntity != null) + { + group.Children.Add(childCalculationGroupEntity.ReadAsPipingCalculationGroup(collector, generalPipingInput)); + } + + var childCalculationEntity = childEntity as PipingCalculationEntity; + if (childCalculationEntity != null) + { + group.Children.Add(childCalculationEntity.Read(collector, generalPipingInput)); + } + } + + return group; + } + + /// + /// Read the and use the information to construct + /// a . + /// + /// The to create + /// for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + internal static CalculationGroup ReadAsMacroStabilityInwardsCalculationGroup(this CalculationGroupEntity entity, + ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + var group = new CalculationGroup + { + Name = entity.Name + }; + + foreach (object childEntity in GetChildEntitiesInOrder(entity)) + { + var childCalculationGroupEntity = childEntity as CalculationGroupEntity; + if (childCalculationGroupEntity != null) + { + group.Children.Add(childCalculationGroupEntity.ReadAsMacroStabilityInwardsCalculationGroup(collector)); + } + + var childCalculationEntity = childEntity as MacroStabilityInwardsCalculationEntity; + if (childCalculationEntity != null) + { + group.Children.Add(childCalculationEntity.Read(collector)); + } + } + + return group; + } + + /// + /// Read the and use the information to construct + /// a . + /// + /// The to create + /// for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + internal static CalculationGroup ReadAsGrassCoverErosionInwardsCalculationGroup(this CalculationGroupEntity entity, + ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + var group = new CalculationGroup + { + Name = entity.Name + }; + + foreach (object childEntity in GetChildEntitiesInOrder(entity)) + { + var childCalculationGroupEntity = childEntity as CalculationGroupEntity; + if (childCalculationGroupEntity != null) + { + group.Children.Add(childCalculationGroupEntity.ReadAsGrassCoverErosionInwardsCalculationGroup(collector)); + } + + var childCalculationEntity = childEntity as GrassCoverErosionInwardsCalculationEntity; + if (childCalculationEntity != null) + { + group.Children.Add(childCalculationEntity.Read(collector)); + } + } + + return group; + } + + /// + /// Read the and use the information to construct + /// a . + /// + /// The to create + /// for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + internal static CalculationGroup ReadAsGrassCoverErosionOutwardsWaveConditionsCalculationGroup(this CalculationGroupEntity entity, + ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + var group = new CalculationGroup + { + Name = entity.Name + }; + + foreach (object childEntity in GetChildEntitiesInOrder(entity)) + { + var childCalculationGroupEntity = childEntity as CalculationGroupEntity; + if (childCalculationGroupEntity != null) + { + group.Children.Add(childCalculationGroupEntity.ReadAsGrassCoverErosionOutwardsWaveConditionsCalculationGroup(collector)); + } + + var childCalculationEntity = childEntity as GrassCoverErosionOutwardsWaveConditionsCalculationEntity; + if (childCalculationEntity != null) + { + group.Children.Add(childCalculationEntity.Read(collector)); + } + } + + return group; + } + + /// + /// Read the and use the information to construct + /// a . + /// + /// The to create + /// for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + internal static CalculationGroup ReadAsHeightStructuresCalculationGroup(this CalculationGroupEntity entity, + ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + var group = new CalculationGroup + { + Name = entity.Name + }; + + foreach (object childEntity in GetChildEntitiesInOrder(entity)) + { + var childCalculationGroupEntity = childEntity as CalculationGroupEntity; + if (childCalculationGroupEntity != null) + { + group.Children.Add(childCalculationGroupEntity.ReadAsHeightStructuresCalculationGroup(collector)); + } + + var childCalculationEntity = childEntity as HeightStructuresCalculationEntity; + if (childCalculationEntity != null) + { + group.Children.Add(childCalculationEntity.Read(collector)); + } + } + + return group; + } + + /// + /// Read the and use the information to construct + /// a . + /// + /// The to create + /// for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + internal static CalculationGroup ReadAsClosingStructuresCalculationGroup(this CalculationGroupEntity entity, + ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + var group = new CalculationGroup + { + Name = entity.Name + }; + + foreach (object childEntity in GetChildEntitiesInOrder(entity)) + { + var childCalculationGroupEntity = childEntity as CalculationGroupEntity; + if (childCalculationGroupEntity != null) + { + group.Children.Add(childCalculationGroupEntity.ReadAsClosingStructuresCalculationGroup(collector)); + } + + var childCalculationEntity = childEntity as ClosingStructuresCalculationEntity; + if (childCalculationEntity != null) + { + group.Children.Add(childCalculationEntity.Read(collector)); + } + } + + return group; + } + + /// + /// Read the and use the information to construct + /// a . + /// + /// The to create + /// for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + internal static CalculationGroup ReadAsStabilityPointStructuresCalculationGroup(this CalculationGroupEntity entity, + ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + var group = new CalculationGroup + { + Name = entity.Name + }; + + foreach (object childEntity in GetChildEntitiesInOrder(entity)) + { + var childCalculationGroupEntity = childEntity as CalculationGroupEntity; + if (childCalculationGroupEntity != null) + { + group.Children.Add(childCalculationGroupEntity.ReadAsStabilityPointStructuresCalculationGroup(collector)); + } + + var childCalculationEntity = childEntity as StabilityPointStructuresCalculationEntity; + if (childCalculationEntity != null) + { + group.Children.Add(childCalculationEntity.Read(collector)); + } + } + + return group; + } + + /// + /// Read the and use the information to construct + /// a . + /// + /// The to create + /// for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + internal static CalculationGroup ReadAsStabilityStoneCoverWaveConditionsCalculationGroup(this CalculationGroupEntity entity, + ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + var group = new CalculationGroup + { + Name = entity.Name + }; + + foreach (object childEntity in GetChildEntitiesInOrder(entity)) + { + var childCalculationGroupEntity = childEntity as CalculationGroupEntity; + if (childCalculationGroupEntity != null) + { + group.Children.Add(childCalculationGroupEntity.ReadAsStabilityStoneCoverWaveConditionsCalculationGroup(collector)); + } + + var childCalculationEntity = childEntity as StabilityStoneCoverWaveConditionsCalculationEntity; + if (childCalculationEntity != null) + { + group.Children.Add(childCalculationEntity.Read(collector)); + } + } + + return group; + } + + /// + /// Read the and use the information to construct + /// a . + /// + /// The to create + /// for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + internal static CalculationGroup ReadAsWaveImpactAsphaltCoverWaveConditionsCalculationGroup(this CalculationGroupEntity entity, + ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + var group = new CalculationGroup + { + Name = entity.Name + }; + + foreach (object childEntity in GetChildEntitiesInOrder(entity)) + { + var childCalculationGroupEntity = childEntity as CalculationGroupEntity; + if (childCalculationGroupEntity != null) + { + group.Children.Add(childCalculationGroupEntity.ReadAsWaveImpactAsphaltCoverWaveConditionsCalculationGroup(collector)); + } + + var childCalculationEntity = childEntity as WaveImpactAsphaltCoverWaveConditionsCalculationEntity; + if (childCalculationEntity != null) + { + group.Children.Add(childCalculationEntity.Read(collector)); + } + } + + return group; + } + + private static IEnumerable GetChildEntitiesInOrder(CalculationGroupEntity entity) + { + var sortedList = new SortedList(); + foreach (CalculationGroupEntity groupEntity in entity.CalculationGroupEntity1) + { + sortedList.Add(groupEntity.Order, groupEntity); + } + + foreach (PipingCalculationEntity calculationEntity in entity.PipingCalculationEntities) + { + sortedList.Add(calculationEntity.Order, calculationEntity); + } + + foreach (GrassCoverErosionInwardsCalculationEntity calculationEntity in entity.GrassCoverErosionInwardsCalculationEntities) + { + sortedList.Add(calculationEntity.Order, calculationEntity); + } + + foreach (GrassCoverErosionOutwardsWaveConditionsCalculationEntity calculationEntity in entity.GrassCoverErosionOutwardsWaveConditionsCalculationEntities) + { + sortedList.Add(calculationEntity.Order, calculationEntity); + } + + foreach (HeightStructuresCalculationEntity calculationEntity in entity.HeightStructuresCalculationEntities) + { + sortedList.Add(calculationEntity.Order, calculationEntity); + } + + foreach (ClosingStructuresCalculationEntity calculationEntity in entity.ClosingStructuresCalculationEntities) + { + sortedList.Add(calculationEntity.Order, calculationEntity); + } + + foreach (StabilityPointStructuresCalculationEntity calculationEntity in entity.StabilityPointStructuresCalculationEntities) + { + sortedList.Add(calculationEntity.Order, calculationEntity); + } + + foreach (StabilityStoneCoverWaveConditionsCalculationEntity calculationEntity in entity.StabilityStoneCoverWaveConditionsCalculationEntities) + { + sortedList.Add(calculationEntity.Order, calculationEntity); + } + + foreach (WaveImpactAsphaltCoverWaveConditionsCalculationEntity calculationEntity in entity.WaveImpactAsphaltCoverWaveConditionsCalculationEntities) + { + sortedList.Add(calculationEntity.Order, calculationEntity); + } + + foreach (MacroStabilityInwardsCalculationEntity calculationEntity in entity.MacroStabilityInwardsCalculationEntities) + { + sortedList.Add(calculationEntity.Order, calculationEntity); + } + + return sortedList.Values; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ClosingStructures/ClosingStructureEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ClosingStructures/ClosingStructureEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ClosingStructures/ClosingStructureEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,119 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using Core.Common.Base.Geometry; +using Ringtoets.ClosingStructures.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.ClosingStructures +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class ClosingStructureEntityReadExtensions + { + /// + /// Reads the and use the information to update a + /// . + /// + /// The to create for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + internal static ClosingStructure Read(this ClosingStructureEntity entity, ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (collector.Contains(entity)) + { + return collector.Get(entity); + } + + var structure = new ClosingStructure(new ClosingStructure.ConstructionProperties + { + Name = entity.Name, + Id = entity.Id, + Location = new Point2D(entity.X.ToNullAsNaN(), entity.Y.ToNullAsNaN()), + StructureNormalOrientation = (RoundedDouble) entity.StructureNormalOrientation.ToNullAsNaN(), + StorageStructureArea = + { + Mean = (RoundedDouble) entity.StorageStructureAreaMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.StorageStructureAreaCoefficientOfVariation.ToNullAsNaN() + }, + AllowedLevelIncreaseStorage = + { + Mean = (RoundedDouble) entity.AllowedLevelIncreaseStorageMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.AllowedLevelIncreaseStorageStandardDeviation.ToNullAsNaN() + }, + WidthFlowApertures = + { + Mean = (RoundedDouble) entity.WidthFlowAperturesMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.WidthFlowAperturesStandardDeviation.ToNullAsNaN() + }, + LevelCrestStructureNotClosing = + { + Mean = (RoundedDouble) entity.LevelCrestStructureNotClosingMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.LevelCrestStructureNotClosingStandardDeviation.ToNullAsNaN() + }, + InsideWaterLevel = + { + Mean = (RoundedDouble) entity.InsideWaterLevelMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.InsideWaterLevelStandardDeviation.ToNullAsNaN() + }, + ThresholdHeightOpenWeir = + { + Mean = (RoundedDouble) entity.ThresholdHeightOpenWeirMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.ThresholdHeightOpenWeirStandardDeviation.ToNullAsNaN() + }, + AreaFlowApertures = + { + Mean = (RoundedDouble) entity.AreaFlowAperturesMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.AreaFlowAperturesStandardDeviation.ToNullAsNaN() + }, + CriticalOvertoppingDischarge = + { + Mean = (RoundedDouble) entity.CriticalOvertoppingDischargeMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.CriticalOvertoppingDischargeCoefficientOfVariation.ToNullAsNaN() + }, + FlowWidthAtBottomProtection = + { + Mean = (RoundedDouble) entity.FlowWidthAtBottomProtectionMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.FlowWidthAtBottomProtectionStandardDeviation.ToNullAsNaN() + }, + ProbabilityOpenStructureBeforeFlooding = entity.ProbabilityOpenStructureBeforeFlooding.ToNullAsNaN(), + FailureProbabilityOpenStructure = entity.FailureProbabilityOpenStructure.ToNullAsNaN(), + IdenticalApertures = entity.IdenticalApertures, + FailureProbabilityReparation = entity.FailureProbabilityReparation.ToNullAsNaN(), + InflowModelType = (ClosingStructureInflowModelType) entity.InflowModelType + }); + + collector.Read(entity, structure); + + return structure; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ClosingStructures/ClosingStructuresCalculationEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ClosingStructures/ClosingStructuresCalculationEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ClosingStructures/ClosingStructuresCalculationEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,120 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Linq; +using Core.Common.Base.Data; +using Ringtoets.ClosingStructures.Data; +using Ringtoets.Common.Data.Structures; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Read.IllustrationPoints; + +namespace Ringtoets.Storage.Core.Read.ClosingStructures +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class ClosingStructuresCalculationEntityReadExtensions + { + /// + /// Reads the and use the + /// information to update a . + /// + /// The + /// to create for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + internal static StructuresCalculation Read(this ClosingStructuresCalculationEntity entity, + ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (collector.Contains(entity)) + { + return collector.Get(entity); + } + + var calculation = new StructuresCalculation + { + Name = entity.Name, + Comments = + { + Body = entity.Comments + } + }; + ReadInputParameters(calculation.InputParameters, entity, collector); + ReadOutput(calculation, entity); + + collector.Read(entity, calculation); + + return calculation; + } + + private static void ReadInputParameters(ClosingStructuresInput inputParameters, + ClosingStructuresCalculationEntity entity, + ReadConversionCollector collector) + { + if (entity.ClosingStructureEntity != null) + { + inputParameters.Structure = entity.ClosingStructureEntity.Read(collector); + } + + entity.Read(inputParameters, collector); + + inputParameters.InflowModelType = (ClosingStructureInflowModelType) entity.InflowModelType; + inputParameters.InsideWaterLevel.Mean = (RoundedDouble) entity.InsideWaterLevelMean.ToNullAsNaN(); + inputParameters.InsideWaterLevel.StandardDeviation = (RoundedDouble) entity.InsideWaterLevelStandardDeviation.ToNullAsNaN(); + inputParameters.DeviationWaveDirection = (RoundedDouble) entity.DeviationWaveDirection.ToNullAsNaN(); + inputParameters.ModelFactorSuperCriticalFlow.Mean = (RoundedDouble) entity.ModelFactorSuperCriticalFlowMean.ToNullAsNaN(); + inputParameters.DrainCoefficient.Mean = (RoundedDouble) entity.DrainCoefficientMean.ToNullAsNaN(); + inputParameters.FactorStormDurationOpenStructure = (RoundedDouble) entity.FactorStormDurationOpenStructure.ToNullAsNaN(); + inputParameters.ThresholdHeightOpenWeir.Mean = (RoundedDouble) entity.ThresholdHeightOpenWeirMean.ToNullAsNaN(); + inputParameters.ThresholdHeightOpenWeir.StandardDeviation = (RoundedDouble) entity.ThresholdHeightOpenWeirStandardDeviation.ToNullAsNaN(); + inputParameters.AreaFlowApertures.Mean = (RoundedDouble) entity.AreaFlowAperturesMean.ToNullAsNaN(); + inputParameters.AreaFlowApertures.StandardDeviation = (RoundedDouble) entity.AreaFlowAperturesStandardDeviation.ToNullAsNaN(); + inputParameters.FailureProbabilityOpenStructure = entity.FailureProbabilityOpenStructure; + inputParameters.FailureProbabilityReparation = entity.FailureProbabilityReparation; + inputParameters.IdenticalApertures = entity.IdenticalApertures; + inputParameters.LevelCrestStructureNotClosing.Mean = (RoundedDouble) entity.LevelCrestStructureNotClosingMean.ToNullAsNaN(); + inputParameters.LevelCrestStructureNotClosing.StandardDeviation = (RoundedDouble) entity.LevelCrestStructureNotClosingStandardDeviation.ToNullAsNaN(); + inputParameters.ProbabilityOpenStructureBeforeFlooding = entity.ProbabilityOpenStructureBeforeFlooding; + } + + private static void ReadOutput(StructuresCalculation calculation, + ClosingStructuresCalculationEntity entity) + { + ClosingStructuresOutputEntity outputEntity = entity.ClosingStructuresOutputEntities.FirstOrDefault(); + if (outputEntity == null) + { + return; + } + + var output = new StructuresOutput(outputEntity.Reliability.ToNullAsNaN(), + outputEntity.GeneralResultFaultTreeIllustrationPointEntity?.Read()); + calculation.Output = output; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ClosingStructures/ClosingStructuresFailureMechanismMetaEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ClosingStructures/ClosingStructuresFailureMechanismMetaEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ClosingStructures/ClosingStructuresFailureMechanismMetaEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,55 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.ClosingStructures.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.ClosingStructures +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class ClosingStructuresFailureMechanismMetaEntityReadExtensions + { + /// + /// Read the and use the information to + /// construct a . + /// + /// The to create + /// for. + /// A new . + /// Thrown when is null. + internal static GeneralClosingStructuresInput Read(this ClosingStructuresFailureMechanismMetaEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return new GeneralClosingStructuresInput + { + N2A = entity.N2A + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ClosingStructures/ClosingStructuresSectionResultEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ClosingStructures/ClosingStructuresSectionResultEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ClosingStructures/ClosingStructuresSectionResultEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,76 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.ClosingStructures.Data; +using Ringtoets.Common.Primitives; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.ClosingStructures +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class ClosingStructuresSectionResultEntityReadExtensions + { + /// + /// Reads the and use the information to update a + /// . + /// + /// The used to update + /// the . + /// The target of the read operation. + /// The object keeping track of read operations. + /// Thrown when any input parameter is null. + internal static void Read(this ClosingStructuresSectionResultEntity entity, + ClosingStructuresFailureMechanismSectionResult sectionResult, + ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (sectionResult == null) + { + throw new ArgumentNullException(nameof(sectionResult)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + sectionResult.SimpleAssessmentResult = (SimpleAssessmentResultType) entity.SimpleAssessmentResult; + sectionResult.DetailedAssessmentResult = (DetailedAssessmentProbabilityOnlyResultType) entity.DetailedAssessmentResult; + sectionResult.TailorMadeAssessmentResult = (TailorMadeAssessmentProbabilityCalculationResultType) entity.TailorMadeAssessmentResult; + sectionResult.TailorMadeAssessmentProbability = entity.TailorMadeAssessmentProbability.ToNullAsNaN(); + sectionResult.UseManualAssembly = Convert.ToBoolean(entity.UseManualAssembly); + sectionResult.ManualAssemblyProbability = entity.ManualAssemblyProbability.ToNullAsNaN(); + + if (entity.ClosingStructuresCalculationEntity != null) + { + sectionResult.Calculation = entity.ClosingStructuresCalculationEntity.Read(collector); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/DuneErosion/DuneErosionFailureMechanismMetaEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/DuneErosion/DuneErosionFailureMechanismMetaEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/DuneErosion/DuneErosionFailureMechanismMetaEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,58 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using Ringtoets.DuneErosion.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.DuneErosion +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class DuneErosionFailureMechanismMetaEntityReadExtensions + { + /// + /// Read the and use the information to update + /// the . + /// + /// The to use to update + /// the . + /// The to be updated. + /// Thrown when any input parameter is null. + internal static void Read(this DuneErosionFailureMechanismMetaEntity entity, GeneralDuneErosionInput input) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (input == null) + { + throw new ArgumentNullException(nameof(input)); + } + + input.N = (RoundedDouble) entity.N; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/DuneErosion/DuneErosionSectionResultEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/DuneErosion/DuneErosionSectionResultEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/DuneErosion/DuneErosionSectionResultEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,66 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.AssemblyTool.Data; +using Ringtoets.Common.Primitives; +using Ringtoets.DuneErosion.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.DuneErosion +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class DuneErosionSectionResultEntityReadExtensions + { + /// + /// Reads the and use the information to update a + /// . + /// + /// The used to update . + /// The target of the read operation. + /// Thrown when any parameter is null. + internal static void Read(this DuneErosionSectionResultEntity entity, DuneErosionFailureMechanismSectionResult sectionResult) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (sectionResult == null) + { + throw new ArgumentNullException(nameof(sectionResult)); + } + + sectionResult.SimpleAssessmentResult = (SimpleAssessmentValidityOnlyResultType) entity.SimpleAssessmentResult; + sectionResult.DetailedAssessmentResultForFactorizedSignalingNorm = (DetailedAssessmentResultType) entity.DetailedAssessmentResultForFactorizedSignalingNorm; + sectionResult.DetailedAssessmentResultForSignalingNorm = (DetailedAssessmentResultType) entity.DetailedAssessmentResultForSignalingNorm; + sectionResult.DetailedAssessmentResultForMechanismSpecificLowerLimitNorm = (DetailedAssessmentResultType) entity.DetailedAssessmentResultForMechanismSpecificLowerLimitNorm; + sectionResult.DetailedAssessmentResultForLowerLimitNorm = (DetailedAssessmentResultType) entity.DetailedAssessmentResultForLowerLimitNorm; + sectionResult.DetailedAssessmentResultForFactorizedLowerLimitNorm = (DetailedAssessmentResultType) entity.DetailedAssessmentResultForFactorizedLowerLimitNorm; + sectionResult.TailorMadeAssessmentResult = (TailorMadeAssessmentCategoryGroupResultType) entity.TailorMadeAssessmentResult; + sectionResult.UseManualAssembly = Convert.ToBoolean(entity.UseManualAssembly); + sectionResult.ManualAssemblyCategoryGroup = (FailureMechanismSectionAssemblyCategoryGroup) entity.ManualAssemblyCategoryGroup; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/DuneErosion/DuneLocationCalculationCollectionEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/DuneErosion/DuneLocationCalculationCollectionEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/DuneErosion/DuneLocationCalculationCollectionEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,76 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using Ringtoets.DuneErosion.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.DuneErosion +{ + /// + /// This class defines extension methods for read operations for a collection of + /// based on the . + /// + internal static class DuneLocationCalculationCollectionEntityReadExtensions + { + /// + /// Reads the and uses the information + /// to update a collection of . + /// + /// The to update the + /// . + /// The target of the read operation. + /// The object keeping track of the read operations. + /// Thrown when any parameter is null. + internal static void Read(this DuneLocationCalculationCollectionEntity entity, + IEnumerable calculations, + ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (calculations == null) + { + throw new ArgumentNullException(nameof(calculations)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + Dictionary calculationsLookup = + calculations.ToDictionary(calc => calc.DuneLocation, calc => calc); + + foreach (DuneLocationCalculationEntity calculationEntity in entity.DuneLocationCalculationEntities) + { + DuneLocation duneLocation = collector.Get(calculationEntity.DuneLocationEntity); + DuneLocationCalculation calculation = calculationsLookup[duneLocation]; + + calculationEntity.Read(calculation); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/DuneErosion/DuneLocationCalculationEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/DuneErosion/DuneLocationCalculationEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/DuneErosion/DuneLocationCalculationEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Linq; +using Ringtoets.DuneErosion.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.DuneErosion +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class DuneLocationCalculationEntityReadExtensions + { + /// + /// Reads the and uses the information to update a + /// . + /// + /// The to update the + /// . + /// The target of the read operation. + /// Thrown when any parameter is null. + internal static void Read(this DuneLocationCalculationEntity entity, DuneLocationCalculation calculation) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (calculation == null) + { + throw new ArgumentNullException(nameof(calculation)); + } + + DuneLocationCalculationOutputEntity duneLocationCalculationOutputEntity = entity.DuneLocationCalculationOutputEntities.SingleOrDefault(); + if (duneLocationCalculationOutputEntity != null) + { + calculation.Output = duneLocationCalculationOutputEntity.Read(); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/DuneErosion/DuneLocationCalculationOutputEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/DuneErosion/DuneLocationCalculationOutputEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/DuneErosion/DuneLocationCalculationOutputEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,60 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.DuneErosion.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.DuneErosion +{ + /// + /// Extension methods for related to creating + /// a . + /// + internal static class DuneLocationCalculationOutputEntityReadExtensions + { + /// + /// Read the and use the information to construct a . + /// + /// The to create for. + /// A new . + /// Thrown when is null. + internal static DuneLocationCalculationOutput Read(this DuneLocationCalculationOutputEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return new DuneLocationCalculationOutput((CalculationConvergence) entity.CalculationConvergence, new DuneLocationCalculationOutput.ConstructionProperties + { + WaterLevel = entity.WaterLevel.ToNullAsNaN(), + WaveHeight = entity.WaveHeight.ToNullAsNaN(), + WavePeriod = entity.WavePeriod.ToNullAsNaN(), + TargetProbability = entity.TargetProbability.ToNullAsNaN(), + TargetReliability = entity.TargetReliability.ToNullAsNaN(), + CalculatedProbability = entity.CalculatedProbability.ToNullAsNaN(), + CalculatedReliability = entity.CalculatedReliability.ToNullAsNaN() + }); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/DuneErosion/DuneLocationEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/DuneErosion/DuneLocationEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/DuneErosion/DuneLocationEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,73 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Geometry; +using Ringtoets.DuneErosion.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.DuneErosion +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class DuneLocationEntityReadExtensions + { + /// + /// Read the and use the information to construct a . + /// + /// The to create for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when any input parameter is null. + internal static DuneLocation Read(this DuneLocationEntity entity, ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (collector.Contains(entity)) + { + return collector.Get(entity); + } + + var duneLocation = new DuneLocation(entity.LocationId, entity.Name, + new Point2D(entity.LocationX.ToNullAsNaN(), entity.LocationY.ToNullAsNaN()), + new DuneLocation.ConstructionProperties + { + CoastalAreaId = entity.CoastalAreaId, + Offset = entity.Offset.ToNullAsNaN(), + Orientation = entity.Orientation.ToNullAsNaN(), + D50 = entity.D50.ToNullAsNaN() + }); + + collector.Read(entity, duneLocation); + return duneLocation; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/FailureMechanismEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/FailureMechanismEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/FailureMechanismEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,1123 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Linq; +using Core.Common.Base.Data; +using Ringtoets.ClosingStructures.Data; +using Ringtoets.Common.Data; +using Ringtoets.Common.Data.Calculation; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.DuneErosion.Data; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.GrassCoverErosionOutwards.Data; +using Ringtoets.HeightStructures.Data; +using Ringtoets.Integration.Data.StandAlone; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.Piping.Data; +using Ringtoets.StabilityPointStructures.Data; +using Ringtoets.StabilityStoneCover.Data; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Read.ClosingStructures; +using Ringtoets.Storage.Core.Read.DuneErosion; +using Ringtoets.Storage.Core.Read.GrassCoverErosionInwards; +using Ringtoets.Storage.Core.Read.GrassCoverErosionOutwards; +using Ringtoets.Storage.Core.Read.HeightStructures; +using Ringtoets.Storage.Core.Read.MacroStabilityInwards; +using Ringtoets.Storage.Core.Read.MacroStabilityOutwards; +using Ringtoets.Storage.Core.Read.Piping; +using Ringtoets.Storage.Core.Read.PipingStructure; +using Ringtoets.Storage.Core.Read.StabilityPointStructures; +using Ringtoets.Storage.Core.Read.StabilityStoneCover; +using Ringtoets.Storage.Core.Read.WaveImpactAsphaltCover; +using Ringtoets.WaveImpactAsphaltCover.Data; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class FailureMechanismEntityReadExtensions + { + /// + /// Read the and use the information to update a . + /// + /// The to read into a . + /// The target of the read operation. + /// The object keeping track of read operations. + internal static void ReadCommonFailureMechanismProperties(this FailureMechanismEntity entity, + IFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + failureMechanism.IsRelevant = Convert.ToBoolean(entity.IsRelevant); + failureMechanism.InputComments.Body = entity.InputComments; + failureMechanism.OutputComments.Body = entity.OutputComments; + failureMechanism.NotRelevantComments.Body = entity.NotRelevantComments; + + entity.ReadFailureMechanismSections(failureMechanism, collector); + } + + private static void ReadFailureMechanismSections(this FailureMechanismEntity entity, + IFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + FailureMechanismSection[] readFailureMechanismSections = entity.FailureMechanismSectionEntities + .Select(failureMechanismSectionEntity => + failureMechanismSectionEntity.Read(collector)) + .ToArray(); + if (readFailureMechanismSections.Any()) + { + failureMechanism.SetSections(readFailureMechanismSections, entity.FailureMechanismSectionCollectionSourcePath); + } + } + + private static void ReadForeshoreProfiles(this FailureMechanismEntity entity, + ForeshoreProfileCollection foreshoreProfiles, + string foreshoreProfileSourcePath, + ReadConversionCollector collector) + { + if (foreshoreProfileSourcePath != null) + { + foreshoreProfiles.AddRange(entity.ForeshoreProfileEntities + .OrderBy(fpe => fpe.Order) + .Select(foreshoreProfileEntity => foreshoreProfileEntity.Read(collector)) + .ToArray(), + foreshoreProfileSourcePath); + } + } + + #region Piping + + /// + /// Read the and use the information to update a . + /// + /// The to read into a . + /// The target of the read operation. + /// The object keeping track of read operations. + /// Thrown when any input parameter is null. + /// Thrown when expected table entries cannot be found. + internal static void ReadAsPipingFailureMechanism(this FailureMechanismEntity entity, + PipingFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); + + PipingFailureMechanismMetaEntity metaEntity = entity.PipingFailureMechanismMetaEntities.Single(); + metaEntity.ReadProbabilityAssessmentInput(failureMechanism.PipingProbabilityAssessmentInput); + metaEntity.ReadGeneralPipingInput(failureMechanism.GeneralInput); + + string stochasticSoilModelCollectionSourcePath = metaEntity.StochasticSoilModelCollectionSourcePath; + if (stochasticSoilModelCollectionSourcePath != null) + { + failureMechanism.StochasticSoilModels.AddRange(entity.StochasticSoilModelEntities + .OrderBy(ssm => ssm.Order) + .Select(e => e.ReadAsPipingStochasticSoilModel(collector)) + .ToArray(), + stochasticSoilModelCollectionSourcePath); + } + + string surfaceLineCollectionSourcePath = metaEntity.SurfaceLineCollectionSourcePath; + if (surfaceLineCollectionSourcePath != null) + { + failureMechanism.SurfaceLines.AddRange(entity.SurfaceLineEntities + .OrderBy(sl => sl.Order) + .Select(e => e.ReadAsPipingSurfaceLine(collector)) + .ToArray(), + surfaceLineCollectionSourcePath); + } + + entity.ReadPipingMechanismSectionResults(failureMechanism, collector); + + ReadPipingRootCalculationGroup(entity.CalculationGroupEntity, failureMechanism.CalculationsGroup, + failureMechanism.GeneralInput, collector); + } + + private static void ReadPipingMechanismSectionResults(this FailureMechanismEntity entity, + PipingFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + foreach (PipingSectionResultEntity sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.PipingSectionResultEntities)) + { + FailureMechanismSection failureMechanismSection = collector.Get(sectionResultEntity.FailureMechanismSectionEntity); + PipingFailureMechanismSectionResult result = failureMechanism.SectionResults.Single(sr => ReferenceEquals(sr.Section, failureMechanismSection)); + + sectionResultEntity.Read(result); + } + } + + private static void ReadPipingRootCalculationGroup(CalculationGroupEntity rootCalculationGroupEntity, + CalculationGroup targetRootCalculationGroup, + GeneralPipingInput generalPipingInput, + ReadConversionCollector collector) + { + CalculationGroup rootCalculationGroup = rootCalculationGroupEntity.ReadAsPipingCalculationGroup(collector, generalPipingInput); + foreach (ICalculationBase calculationBase in rootCalculationGroup.Children) + { + targetRootCalculationGroup.Children.Add(calculationBase); + } + } + + #endregion + + #region Grass Cover Erosion Inwards + + /// + /// Read the and use the information to update a . + /// + /// The to read into a . + /// The target of the read operation. + /// The object keeping track of read operations. + internal static void ReadAsGrassCoverErosionInwardsFailureMechanism(this FailureMechanismEntity entity, + GrassCoverErosionInwardsFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); + entity.ReadGeneralGrassCoverErosionInwardsCalculationInput(failureMechanism.GeneralInput); + entity.ReadDikeProfiles(failureMechanism.DikeProfiles, collector); + ReadGrassCoverErosionInwardsRootCalculationGroup(entity.CalculationGroupEntity, failureMechanism.CalculationsGroup, collector); + entity.ReadGrassCoverErosionInwardsMechanismSectionResults(failureMechanism, collector); + } + + private static void ReadGeneralGrassCoverErosionInwardsCalculationInput(this FailureMechanismEntity entity, + GeneralGrassCoverErosionInwardsInput input) + { + entity.GrassCoverErosionInwardsFailureMechanismMetaEntities.Single().Read(input); + } + + private static void ReadDikeProfiles(this FailureMechanismEntity entity, DikeProfileCollection dikeProfiles, ReadConversionCollector collector) + { + if (entity.DikeProfileEntities.Any()) + { + GrassCoverErosionInwardsFailureMechanismMetaEntity metaEntity = + entity.GrassCoverErosionInwardsFailureMechanismMetaEntities.Single(); + string sourcePath = metaEntity.DikeProfileCollectionSourcePath; + + dikeProfiles.AddRange(entity.DikeProfileEntities + .OrderBy(dp => dp.Order) + .Select(dp => dp.Read(collector)) + .ToArray(), + sourcePath); + } + } + + private static void ReadGrassCoverErosionInwardsMechanismSectionResults(this FailureMechanismEntity entity, + GrassCoverErosionInwardsFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + foreach (GrassCoverErosionInwardsSectionResultEntity sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.GrassCoverErosionInwardsSectionResultEntities)) + { + FailureMechanismSection failureMechanismSection = collector.Get(sectionResultEntity.FailureMechanismSectionEntity); + GrassCoverErosionInwardsFailureMechanismSectionResult result = failureMechanism.SectionResults.Single(sr => ReferenceEquals(sr.Section, failureMechanismSection)); + + sectionResultEntity.Read(result, collector); + } + } + + private static void ReadGrassCoverErosionInwardsRootCalculationGroup(CalculationGroupEntity rootCalculationGroupEntity, + CalculationGroup targetRootCalculationGroup, + ReadConversionCollector collector) + { + CalculationGroup rootCalculationGroup = rootCalculationGroupEntity.ReadAsGrassCoverErosionInwardsCalculationGroup(collector); + foreach (ICalculationBase calculationBase in rootCalculationGroup.Children) + { + targetRootCalculationGroup.Children.Add(calculationBase); + } + } + + #endregion + + #region Height Structures + + /// + /// Read the and use the information to update a . + /// + /// The to create for. + /// The target of the read operation. + /// The object keeping track of read operations. + /// Thrown when expected table entries could not be found.> + internal static void ReadAsHeightStructuresFailureMechanism(this FailureMechanismEntity entity, + HeightStructuresFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + HeightStructuresFailureMechanismMetaEntity metaEntity = entity.HeightStructuresFailureMechanismMetaEntities.Single(); + entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); + entity.ReadHeightStructuresMechanismSectionResults(failureMechanism, collector); + entity.ReadForeshoreProfiles(failureMechanism.ForeshoreProfiles, metaEntity.ForeshoreProfileCollectionSourcePath, collector); + entity.ReadHeightStructures(failureMechanism.HeightStructures, metaEntity.HeightStructureCollectionSourcePath, collector); + entity.ReadGeneralInput(failureMechanism.GeneralInput); + ReadHeightStructuresRootCalculationGroup(entity.CalculationGroupEntity, failureMechanism.CalculationsGroup, collector); + } + + private static void ReadHeightStructuresMechanismSectionResults(this FailureMechanismEntity entity, + HeightStructuresFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + foreach (HeightStructuresSectionResultEntity sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.HeightStructuresSectionResultEntities)) + { + FailureMechanismSection failureMechanismSection = collector.Get(sectionResultEntity.FailureMechanismSectionEntity); + HeightStructuresFailureMechanismSectionResult result = failureMechanism.SectionResults.Single(sr => ReferenceEquals(sr.Section, failureMechanismSection)); + + sectionResultEntity.Read(result, collector); + } + } + + private static void ReadHeightStructures(this FailureMechanismEntity entity, + StructureCollection heightStructures, + string sourcePath, + ReadConversionCollector collector) + { + if (sourcePath != null) + { + heightStructures.AddRange(entity.HeightStructureEntities + .OrderBy(fpe => fpe.Order) + .Select(structureEntity => structureEntity.Read(collector)) + .ToArray(), + sourcePath); + } + } + + private static void ReadGeneralInput(this FailureMechanismEntity entity, GeneralHeightStructuresInput generalInput) + { + GeneralHeightStructuresInput generalHeightStructuresInput = entity.HeightStructuresFailureMechanismMetaEntities.First().Read(); + generalInput.N = generalHeightStructuresInput.N; + } + + private static void ReadHeightStructuresRootCalculationGroup(CalculationGroupEntity rootCalculationGroupEntity, + CalculationGroup targetRootCalculationGroup, + ReadConversionCollector collector) + { + CalculationGroup rootCalculationGroup = rootCalculationGroupEntity.ReadAsHeightStructuresCalculationGroup(collector); + foreach (ICalculationBase calculationBase in rootCalculationGroup.Children) + { + targetRootCalculationGroup.Children.Add(calculationBase); + } + } + + #endregion + + #region Strength Stability Lengthwise Construction + + /// + /// Read the and use the information to update a . + /// + /// The to create for. + /// The target of the read operation. + /// The object keeping track of read operations. + internal static void ReadAsStrengthStabilityLengthwiseConstructionFailureMechanism(this FailureMechanismEntity entity, + StrengthStabilityLengthwiseConstructionFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); + entity.ReadStrengthStabilityLengthwiseConstructionMechanismSectionResults(failureMechanism, collector); + } + + private static void ReadStrengthStabilityLengthwiseConstructionMechanismSectionResults(this FailureMechanismEntity entity, + StrengthStabilityLengthwiseConstructionFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + foreach (StrengthStabilityLengthwiseConstructionSectionResultEntity sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.StrengthStabilityLengthwiseConstructionSectionResultEntities)) + { + FailureMechanismSection failureMechanismSection = collector.Get(sectionResultEntity.FailureMechanismSectionEntity); + StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult result = failureMechanism.SectionResults.Single(sr => ReferenceEquals(sr.Section, failureMechanismSection)); + + sectionResultEntity.Read(result); + } + } + + #endregion + + #region Technical Innovation + + /// + /// Read the and use the information to update a . + /// + /// The to create for. + /// The target of the read operation. + /// The object keeping track of read operations. + internal static void ReadAsTechnicalInnovationFailureMechanism(this FailureMechanismEntity entity, + TechnicalInnovationFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); + entity.ReadTechnicalInnovationMechanismSectionResults(failureMechanism, collector); + } + + private static void ReadTechnicalInnovationMechanismSectionResults(this FailureMechanismEntity entity, + TechnicalInnovationFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + foreach (TechnicalInnovationSectionResultEntity sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.TechnicalInnovationSectionResultEntities)) + { + FailureMechanismSection failureMechanismSection = collector.Get(sectionResultEntity.FailureMechanismSectionEntity); + TechnicalInnovationFailureMechanismSectionResult result = failureMechanism.SectionResults.Single(sr => ReferenceEquals(sr.Section, failureMechanismSection)); + + sectionResultEntity.Read(result); + } + } + + #endregion + + #region Water Pressure Asphalt + + /// + /// Read the and use the information to update a . + /// + /// The to create for. + /// The target of the read operation. + /// The object keeping track of read operations. + internal static void ReadAsWaterPressureAsphaltCoverFailureMechanism(this FailureMechanismEntity entity, + WaterPressureAsphaltCoverFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); + entity.ReadWaterPressureAsphaltCoverMechanismSectionResults(failureMechanism, collector); + } + + private static void ReadWaterPressureAsphaltCoverMechanismSectionResults(this FailureMechanismEntity entity, + WaterPressureAsphaltCoverFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + foreach (WaterPressureAsphaltCoverSectionResultEntity sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.WaterPressureAsphaltCoverSectionResultEntities)) + { + FailureMechanismSection failureMechanismSection = collector.Get(sectionResultEntity.FailureMechanismSectionEntity); + WaterPressureAsphaltCoverFailureMechanismSectionResult result = failureMechanism.SectionResults.Single(sr => ReferenceEquals(sr.Section, failureMechanismSection)); + + sectionResultEntity.Read(result); + } + } + + #endregion + + #region Closing Structures + + /// + /// Read the and use the information to update a . + /// + /// The to create for. + /// The target of the read operation. + /// The object keeping track of read operations. + /// Thrown when expected table entries cannot be found. + internal static void ReadAsClosingStructuresFailureMechanism(this FailureMechanismEntity entity, + ClosingStructuresFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); + entity.ReadClosingStructuresMechanismSectionResults(failureMechanism, collector); + + ClosingStructuresFailureMechanismMetaEntity metaEntity = entity.ClosingStructuresFailureMechanismMetaEntities.Single(); + + entity.ReadForeshoreProfiles(failureMechanism.ForeshoreProfiles, + metaEntity.ForeshoreProfileCollectionSourcePath, + collector); + entity.ReadClosingStructures(failureMechanism.ClosingStructures, + metaEntity.ClosingStructureCollectionSourcePath, collector); + + entity.ReadGeneralInput(failureMechanism.GeneralInput); + ReadClosingStructuresRootCalculationGroup(entity.CalculationGroupEntity, failureMechanism.CalculationsGroup, collector); + } + + private static void ReadClosingStructuresMechanismSectionResults(this FailureMechanismEntity entity, + ClosingStructuresFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + foreach (ClosingStructuresSectionResultEntity sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.ClosingStructuresSectionResultEntities)) + { + FailureMechanismSection failureMechanismSection = collector.Get(sectionResultEntity.FailureMechanismSectionEntity); + ClosingStructuresFailureMechanismSectionResult result = failureMechanism.SectionResults.Single(sr => ReferenceEquals(sr.Section, failureMechanismSection)); + + sectionResultEntity.Read(result, collector); + } + } + + private static void ReadGeneralInput(this FailureMechanismEntity entity, GeneralClosingStructuresInput generalInput) + { + GeneralClosingStructuresInput generalClosingStructuresInput = entity.ClosingStructuresFailureMechanismMetaEntities.First().Read(); + generalInput.N2A = generalClosingStructuresInput.N2A; + } + + private static void ReadClosingStructures(this FailureMechanismEntity entity, + StructureCollection closingStructures, + string sourcePath, + ReadConversionCollector collector) + { + if (sourcePath != null) + { + closingStructures.AddRange(entity.ClosingStructureEntities + .OrderBy(fpe => fpe.Order) + .Select(structureEntity => structureEntity.Read(collector)) + .ToArray(), + sourcePath); + } + } + + private static void ReadClosingStructuresRootCalculationGroup(CalculationGroupEntity rootCalculationGroupEntity, + CalculationGroup targetRootCalculationGroup, + ReadConversionCollector collector) + { + CalculationGroup rootCalculationGroup = rootCalculationGroupEntity.ReadAsClosingStructuresCalculationGroup(collector); + foreach (ICalculationBase calculationBase in rootCalculationGroup.Children) + { + targetRootCalculationGroup.Children.Add(calculationBase); + } + } + + #endregion + + #region MacroStability Inwards + + /// + /// Read the and use the information to update a . + /// + /// The to create for. + /// The target of the read operation. + /// The object keeping track of read operations. + /// Thrown when any input parameter is null. + /// Thrown when expected table entries could not be found. + internal static void ReadAsMacroStabilityInwardsFailureMechanism(this FailureMechanismEntity entity, + MacroStabilityInwardsFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); + + MacroStabilityInwardsFailureMechanismMetaEntity metaEntity = entity.MacroStabilityInwardsFailureMechanismMetaEntities.Single(); + metaEntity.ReadProbabilityAssessmentInput(failureMechanism.MacroStabilityInwardsProbabilityAssessmentInput); + + string stochasticSoilModelCollectionSourcePath = metaEntity.StochasticSoilModelCollectionSourcePath; + if (stochasticSoilModelCollectionSourcePath != null) + { + failureMechanism.StochasticSoilModels.AddRange(entity.StochasticSoilModelEntities + .OrderBy(ssm => ssm.Order) + .Select(e => e.ReadAsMacroStabilityInwardsStochasticSoilModel(collector)) + .ToArray(), + stochasticSoilModelCollectionSourcePath); + } + + string surfaceLineCollectionSourcePath = metaEntity.SurfaceLineCollectionSourcePath; + if (surfaceLineCollectionSourcePath != null) + { + failureMechanism.SurfaceLines.AddRange(entity.SurfaceLineEntities + .OrderBy(sl => sl.Order) + .Select(e => e.ReadAsMacroStabilityInwardsSurfaceLine(collector)) + .ToArray(), + surfaceLineCollectionSourcePath); + } + + entity.ReadMacroStabilityInwardsMechanismSectionResults(failureMechanism, collector); + ReadMacroStabilityInwardsRootCalculationGroup(entity.CalculationGroupEntity, failureMechanism.CalculationsGroup, collector); + } + + private static void ReadMacroStabilityInwardsMechanismSectionResults(this FailureMechanismEntity entity, + MacroStabilityInwardsFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + foreach (MacroStabilityInwardsSectionResultEntity sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.MacroStabilityInwardsSectionResultEntities)) + { + FailureMechanismSection failureMechanismSection = collector.Get(sectionResultEntity.FailureMechanismSectionEntity); + MacroStabilityInwardsFailureMechanismSectionResult result = failureMechanism.SectionResults.Single(sr => ReferenceEquals(sr.Section, failureMechanismSection)); + + sectionResultEntity.Read(result); + } + } + + private static void ReadMacroStabilityInwardsRootCalculationGroup(CalculationGroupEntity rootCalculationGroupEntity, + CalculationGroup targetRootCalculationGroup, + ReadConversionCollector collector) + { + CalculationGroup rootCalculationGroup = rootCalculationGroupEntity.ReadAsMacroStabilityInwardsCalculationGroup(collector); + foreach (ICalculationBase calculationBase in rootCalculationGroup.Children) + { + targetRootCalculationGroup.Children.Add(calculationBase); + } + } + + #endregion + + #region MacroStability Outwards + + /// + /// Read the and use the information to update a . + /// + /// The to create for. + /// The target of the read operation. + /// The object keeping track of read operations. + /// Thrown when any input parameter is null. + internal static void ReadAsMacroStabilityOutwardsFailureMechanism(this FailureMechanismEntity entity, + MacroStabilityOutwardsFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); + entity.ReadMacroStabilityOutwardsMechanismSectionResults(failureMechanism, collector); + MacroStabilityOutwardsFailureMechanismMetaEntity metaEntity = entity.MacroStabilityOutwardsFailureMechanismMetaEntities.Single(); + metaEntity.ReadProbabilityAssessmentInput(failureMechanism.MacroStabilityOutwardsProbabilityAssessmentInput); + } + + private static void ReadMacroStabilityOutwardsMechanismSectionResults(this FailureMechanismEntity entity, + MacroStabilityOutwardsFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + foreach (MacroStabilityOutwardsSectionResultEntity sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.MacroStabilityOutwardsSectionResultEntities)) + { + FailureMechanismSection failureMechanismSection = collector.Get(sectionResultEntity.FailureMechanismSectionEntity); + MacroStabilityOutwardsFailureMechanismSectionResult result = failureMechanism.SectionResults.Single(sr => ReferenceEquals(sr.Section, failureMechanismSection)); + + sectionResultEntity.Read(result); + } + } + + #endregion + + #region Wave Impact Asphalt Cover + + /// + /// Read the and use the information to update a . + /// + /// The to create for. + /// The target of the read operation. + /// The object keeping track of read operations. + /// Thrown when the expected table entries could not be found. + internal static void ReadAsWaveImpactAsphaltCoverFailureMechanism(this FailureMechanismEntity entity, + WaveImpactAsphaltCoverFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); + entity.ReadWaveImpactAsphaltCoverMechanismSectionResults(failureMechanism, collector); + + WaveImpactAsphaltCoverFailureMechanismMetaEntity metaEntity = entity.WaveImpactAsphaltCoverFailureMechanismMetaEntities.Single(); + entity.ReadForeshoreProfiles(failureMechanism.ForeshoreProfiles, metaEntity.ForeshoreProfileCollectionSourcePath, collector); + + ReadWaveImpactAsphaltCoverRootCalculationGroup(entity.CalculationGroupEntity, failureMechanism.WaveConditionsCalculationGroup, collector); + entity.ReadGeneralInput(failureMechanism.GeneralWaveImpactAsphaltCoverInput); + } + + private static void ReadWaveImpactAsphaltCoverMechanismSectionResults(this FailureMechanismEntity entity, + WaveImpactAsphaltCoverFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + foreach (WaveImpactAsphaltCoverSectionResultEntity sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.WaveImpactAsphaltCoverSectionResultEntities)) + { + FailureMechanismSection failureMechanismSection = collector.Get(sectionResultEntity.FailureMechanismSectionEntity); + WaveImpactAsphaltCoverFailureMechanismSectionResult result = failureMechanism.SectionResults.Single(sr => ReferenceEquals(sr.Section, failureMechanismSection)); + + sectionResultEntity.Read(result); + } + } + + private static void ReadWaveImpactAsphaltCoverRootCalculationGroup(CalculationGroupEntity rootCalculationGroupEntity, + CalculationGroup targetRootCalculationGroup, + ReadConversionCollector collector) + { + CalculationGroup rootCalculationGroup = rootCalculationGroupEntity.ReadAsWaveImpactAsphaltCoverWaveConditionsCalculationGroup(collector); + foreach (ICalculationBase calculationBase in rootCalculationGroup.Children) + { + targetRootCalculationGroup.Children.Add(calculationBase); + } + } + + private static void ReadGeneralInput(this FailureMechanismEntity entity, GeneralWaveImpactAsphaltCoverInput generalInput) + { + GeneralWaveImpactAsphaltCoverInput generalWaveImpactAsphaltCoverInput = entity.WaveImpactAsphaltCoverFailureMechanismMetaEntities.First().Read(); + generalInput.DeltaL = generalWaveImpactAsphaltCoverInput.DeltaL; + } + + #endregion + + #region Grass Cover Erosion Outwards + + /// + /// Read the and use the information to update a . + /// + /// The to create for. + /// The target of the read operation. + /// The object keeping track of read operations. + /// Thrown when expected table entries could not be found. + internal static void ReadAsGrassCoverErosionOutwardsFailureMechanism(this FailureMechanismEntity entity, + GrassCoverErosionOutwardsFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); + entity.ReadGeneralGrassCoverErosionOutwardsCalculationInput(failureMechanism.GeneralInput); + entity.ReadGrassCoverErosionOutwardsMechanismSectionResults(failureMechanism, collector); + + GrassCoverErosionOutwardsFailureMechanismMetaEntity metaEntity = + entity.GrassCoverErosionOutwardsFailureMechanismMetaEntities.Single(); + ReadForeshoreProfiles(entity, + failureMechanism.ForeshoreProfiles, + metaEntity.ForeshoreProfileCollectionSourcePath, + collector); + + entity.ReadHydraulicBoundaryLocationCalculations(failureMechanism, collector); + + ReadGrassCoverErosionOutwardsWaveConditionsRootCalculationGroup(entity.CalculationGroupEntity, failureMechanism.WaveConditionsCalculationGroup, collector); + } + + private static void ReadGeneralGrassCoverErosionOutwardsCalculationInput(this FailureMechanismEntity entity, + GeneralGrassCoverErosionOutwardsInput input) + { + GetGrassCoverErosionOutwardsFailureMechanismMetaEntity(entity).Read(input); + } + + private static void ReadGrassCoverErosionOutwardsMechanismSectionResults(this FailureMechanismEntity entity, + GrassCoverErosionOutwardsFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + foreach (GrassCoverErosionOutwardsSectionResultEntity sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.GrassCoverErosionOutwardsSectionResultEntities)) + { + FailureMechanismSection failureMechanismSection = collector.Get(sectionResultEntity.FailureMechanismSectionEntity); + GrassCoverErosionOutwardsFailureMechanismSectionResult result = failureMechanism.SectionResults.Single(sr => ReferenceEquals(sr.Section, failureMechanismSection)); + + sectionResultEntity.Read(result); + } + } + + private static void ReadHydraulicBoundaryLocationCalculations(this FailureMechanismEntity entity, + GrassCoverErosionOutwardsFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + GrassCoverErosionOutwardsFailureMechanismMetaEntity metaEntity = GetGrassCoverErosionOutwardsFailureMechanismMetaEntity(entity); + + metaEntity.HydraulicLocationCalculationCollectionEntity5.Read(failureMechanism.WaterLevelCalculationsForMechanismSpecificFactorizedSignalingNorm, + collector); + metaEntity.HydraulicLocationCalculationCollectionEntity4.Read(failureMechanism.WaterLevelCalculationsForMechanismSpecificSignalingNorm, + collector); + metaEntity.HydraulicLocationCalculationCollectionEntity3.Read(failureMechanism.WaterLevelCalculationsForMechanismSpecificLowerLimitNorm, + collector); + + metaEntity.HydraulicLocationCalculationCollectionEntity2.Read(failureMechanism.WaveHeightCalculationsForMechanismSpecificFactorizedSignalingNorm, + collector); + metaEntity.HydraulicLocationCalculationCollectionEntity1.Read(failureMechanism.WaveHeightCalculationsForMechanismSpecificSignalingNorm, + collector); + metaEntity.HydraulicLocationCalculationCollectionEntity.Read(failureMechanism.WaveHeightCalculationsForMechanismSpecificLowerLimitNorm, + collector); + } + + private static void ReadGrassCoverErosionOutwardsWaveConditionsRootCalculationGroup(CalculationGroupEntity rootCalculationGroupEntity, + CalculationGroup targetRootCalculationGroup, ReadConversionCollector collector) + { + CalculationGroup rootCalculationGroup = rootCalculationGroupEntity.ReadAsGrassCoverErosionOutwardsWaveConditionsCalculationGroup(collector); + foreach (ICalculationBase calculationBase in rootCalculationGroup.Children) + { + targetRootCalculationGroup.Children.Add(calculationBase); + } + } + + private static GrassCoverErosionOutwardsFailureMechanismMetaEntity GetGrassCoverErosionOutwardsFailureMechanismMetaEntity(FailureMechanismEntity entity) + { + return entity.GrassCoverErosionOutwardsFailureMechanismMetaEntities.Single(); + } + + #endregion + + #region Grass Cover Slip Off Inwards + + /// + /// Read the and use the information to update a . + /// + /// The to create for. + /// The target of the read operation. + /// The object keeping track of read operations. + internal static void ReadAsGrassCoverSlipOffInwardsFailureMechanism(this FailureMechanismEntity entity, + GrassCoverSlipOffInwardsFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); + entity.ReadGrassCoverSlipOffInwardsMechanismSectionResults(failureMechanism, collector); + } + + private static void ReadGrassCoverSlipOffInwardsMechanismSectionResults(this FailureMechanismEntity entity, + GrassCoverSlipOffInwardsFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + foreach (GrassCoverSlipOffInwardsSectionResultEntity sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.GrassCoverSlipOffInwardsSectionResultEntities)) + { + FailureMechanismSection failureMechanismSection = collector.Get(sectionResultEntity.FailureMechanismSectionEntity); + GrassCoverSlipOffInwardsFailureMechanismSectionResult result = failureMechanism.SectionResults.Single(sr => ReferenceEquals(sr.Section, failureMechanismSection)); + + sectionResultEntity.Read(result); + } + } + + #endregion + + #region Grass Cover Slip Off Outwards + + /// + /// Read the and use the information to update a . + /// + /// The to create for. + /// The target of the read operation. + /// The object keeping track of read operations. + internal static void ReadAsGrassCoverSlipOffOutwardsFailureMechanism(this FailureMechanismEntity entity, + GrassCoverSlipOffOutwardsFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); + entity.ReadGrassCoverSlipOffOutwardsMechanismSectionResults(failureMechanism, collector); + } + + private static void ReadGrassCoverSlipOffOutwardsMechanismSectionResults(this FailureMechanismEntity entity, + GrassCoverSlipOffOutwardsFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + foreach (GrassCoverSlipOffOutwardsSectionResultEntity sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.GrassCoverSlipOffOutwardsSectionResultEntities)) + { + FailureMechanismSection failureMechanismSection = collector.Get(sectionResultEntity.FailureMechanismSectionEntity); + GrassCoverSlipOffOutwardsFailureMechanismSectionResult result = failureMechanism.SectionResults.Single(sr => ReferenceEquals(sr.Section, failureMechanismSection)); + + sectionResultEntity.Read(result); + } + } + + #endregion + + #region Microstability + + /// + /// Read the and use the information to update a . + /// + /// The to create for. + /// The target of the read operation. + /// The object keeping track of read operations. + internal static void ReadAsMicrostabilityFailureMechanism(this FailureMechanismEntity entity, + MicrostabilityFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); + entity.ReadMicrostabilityMechanismSectionResults(failureMechanism, collector); + } + + private static void ReadMicrostabilityMechanismSectionResults(this FailureMechanismEntity entity, + MicrostabilityFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + foreach (MicrostabilitySectionResultEntity sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.MicrostabilitySectionResultEntities)) + { + FailureMechanismSection failureMechanismSection = collector.Get(sectionResultEntity.FailureMechanismSectionEntity); + MicrostabilityFailureMechanismSectionResult result = failureMechanism.SectionResults.Single(sr => ReferenceEquals(sr.Section, failureMechanismSection)); + + sectionResultEntity.Read(result); + } + } + + #endregion + + #region Piping Structure + + /// + /// Read the and use the information to update a . + /// + /// The to create for. + /// The target of the read operation. + /// The object keeping track of read operations. + /// Thrown when any input parameter is null. + internal static void ReadAsPipingStructureFailureMechanism(this FailureMechanismEntity entity, + PipingStructureFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); + entity.ReadPipingStructureMechanismSectionResults(failureMechanism, collector); + + failureMechanism.N = (RoundedDouble) entity.PipingStructureFailureMechanismMetaEntities.Single().N; + } + + private static void ReadPipingStructureMechanismSectionResults(this FailureMechanismEntity entity, + PipingStructureFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + foreach (PipingStructureSectionResultEntity sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.PipingStructureSectionResultEntities)) + { + FailureMechanismSection failureMechanismSection = collector.Get(sectionResultEntity.FailureMechanismSectionEntity); + PipingStructureFailureMechanismSectionResult result = failureMechanism.SectionResults.Single(sr => ReferenceEquals(sr.Section, failureMechanismSection)); + + sectionResultEntity.Read(result); + } + } + + #endregion + + #region Dune Erosion + + /// + /// Read the and use the information to update a . + /// + /// The to create for. + /// The target of the read operation. + /// The object keeping track of read operations. + internal static void ReadAsDuneErosionFailureMechanism(this FailureMechanismEntity entity, + DuneErosionFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); + entity.ReadDuneErosionMechanismSectionResults(failureMechanism, collector); + entity.ReadGeneralDuneErosionInput(failureMechanism.GeneralInput); + entity.ReadDuneLocations(failureMechanism, collector); + entity.ReadDuneLocationCalculations(failureMechanism, collector); + } + + private static void ReadGeneralDuneErosionInput(this FailureMechanismEntity entity, GeneralDuneErosionInput input) + { + GetDuneErosionFailureMechanismMetaEntity(entity).Read(input); + } + + private static void ReadDuneErosionMechanismSectionResults(this FailureMechanismEntity entity, + DuneErosionFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + foreach (DuneErosionSectionResultEntity sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.DuneErosionSectionResultEntities)) + { + FailureMechanismSection failureMechanismSection = collector.Get(sectionResultEntity.FailureMechanismSectionEntity); + DuneErosionFailureMechanismSectionResult result = failureMechanism.SectionResults.Single(sr => ReferenceEquals(sr.Section, failureMechanismSection)); + + sectionResultEntity.Read(result); + } + } + + private static void ReadDuneLocations(this FailureMechanismEntity entity, + DuneErosionFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + failureMechanism.SetDuneLocations(entity.DuneLocationEntities + .OrderBy(location => location.Order) + .Select(location => location.Read(collector)) + .ToArray()); + } + + private static void ReadDuneLocationCalculations(this FailureMechanismEntity entity, + DuneErosionFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + DuneErosionFailureMechanismMetaEntity metaEntity = GetDuneErosionFailureMechanismMetaEntity(entity); + + metaEntity.DuneLocationCalculationCollectionEntity4.Read(failureMechanism.CalculationsForMechanismSpecificFactorizedSignalingNorm, collector); + metaEntity.DuneLocationCalculationCollectionEntity3.Read(failureMechanism.CalculationsForMechanismSpecificSignalingNorm, collector); + metaEntity.DuneLocationCalculationCollectionEntity2.Read(failureMechanism.CalculationsForMechanismSpecificLowerLimitNorm, collector); + metaEntity.DuneLocationCalculationCollectionEntity1.Read(failureMechanism.CalculationsForLowerLimitNorm, collector); + metaEntity.DuneLocationCalculationCollectionEntity.Read(failureMechanism.CalculationsForFactorizedLowerLimitNorm, collector); + } + + private static DuneErosionFailureMechanismMetaEntity GetDuneErosionFailureMechanismMetaEntity(FailureMechanismEntity entity) + { + return entity.DuneErosionFailureMechanismMetaEntities.Single(); + } + + #endregion + + #region Stability Stone Cover + + /// + /// Read the and use the information to update a . + /// + /// The to create for. + /// The target of the read operation. + /// The object keeping track of read operations. + /// Thrown when expected table entries cannot be found. + internal static void ReadAsStabilityStoneCoverFailureMechanism(this FailureMechanismEntity entity, + StabilityStoneCoverFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); + entity.ReadStabilityStoneCoverMechanismSectionResults(failureMechanism, collector); + + StabilityStoneCoverFailureMechanismMetaEntity metaEntity = + entity.StabilityStoneCoverFailureMechanismMetaEntities.Single(); + ReadForeshoreProfiles(entity, + failureMechanism.ForeshoreProfiles, + metaEntity.ForeshoreProfileCollectionSourcePath, + collector); + + ReadStabilityStoneCoverWaveConditionsRootCalculationGroup(entity.CalculationGroupEntity, + failureMechanism.WaveConditionsCalculationGroup, + collector); + entity.ReadGeneralInput(failureMechanism.GeneralInput); + } + + private static void ReadStabilityStoneCoverMechanismSectionResults(this FailureMechanismEntity entity, + StabilityStoneCoverFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + foreach (StabilityStoneCoverSectionResultEntity sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.StabilityStoneCoverSectionResultEntities)) + { + FailureMechanismSection failureMechanismSection = collector.Get(sectionResultEntity.FailureMechanismSectionEntity); + StabilityStoneCoverFailureMechanismSectionResult result = failureMechanism.SectionResults.Single(sr => ReferenceEquals(sr.Section, failureMechanismSection)); + + sectionResultEntity.Read(result); + } + } + + private static void ReadStabilityStoneCoverWaveConditionsRootCalculationGroup(CalculationGroupEntity rootCalculationGroupEntity, + CalculationGroup targetRootCalculationGroup, + ReadConversionCollector collector) + { + CalculationGroup rootCalculationGroup = rootCalculationGroupEntity.ReadAsStabilityStoneCoverWaveConditionsCalculationGroup(collector); + foreach (ICalculationBase calculationBase in rootCalculationGroup.Children) + { + targetRootCalculationGroup.Children.Add(calculationBase); + } + } + + private static void ReadGeneralInput(this FailureMechanismEntity entity, GeneralStabilityStoneCoverWaveConditionsInput generalInput) + { + GeneralStabilityStoneCoverWaveConditionsInput generalStabilityPointStructuresInput = entity.StabilityStoneCoverFailureMechanismMetaEntities.First().Read(); + generalInput.N = generalStabilityPointStructuresInput.N; + } + + #endregion + + #region Stability Point Structures + + /// + /// Read the and use the information to update a . + /// + /// The to create for. + /// The target of the read operation. + /// The object keeping track of read operations. + /// Thrown when expected table entries cannot be found. + internal static void ReadAsStabilityPointStructuresFailureMechanism(this FailureMechanismEntity entity, + StabilityPointStructuresFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); + entity.ReadStabilityPointStructuresMechanismSectionResults(failureMechanism, collector); + + StabilityPointStructuresFailureMechanismMetaEntity metaEntity = + entity.StabilityPointStructuresFailureMechanismMetaEntities.Single(); + entity.ReadForeshoreProfiles(failureMechanism.ForeshoreProfiles, + metaEntity.ForeshoreProfileCollectionSourcePath, + collector); + + entity.ReadStabilityPointStructures(failureMechanism.StabilityPointStructures, + metaEntity.StabilityPointStructureCollectionSourcePath, + collector); + entity.ReadGeneralInput(failureMechanism.GeneralInput); + ReadStabilityPointStructuresRootCalculationGroup(entity.CalculationGroupEntity, failureMechanism.CalculationsGroup, collector); + } + + private static void ReadStabilityPointStructuresMechanismSectionResults(this FailureMechanismEntity entity, + StabilityPointStructuresFailureMechanism failureMechanism, + ReadConversionCollector collector) + { + foreach (StabilityPointStructuresSectionResultEntity sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.StabilityPointStructuresSectionResultEntities)) + { + FailureMechanismSection failureMechanismSection = collector.Get(sectionResultEntity.FailureMechanismSectionEntity); + StabilityPointStructuresFailureMechanismSectionResult result = failureMechanism.SectionResults + .Single(sr => ReferenceEquals(sr.Section, failureMechanismSection)); + + sectionResultEntity.Read(result, collector); + } + } + + private static void ReadStabilityPointStructures(this FailureMechanismEntity entity, + StructureCollection stabilityPointStructures, + string sourcePath, + ReadConversionCollector collector) + { + if (sourcePath != null) + { + stabilityPointStructures.AddRange(entity.StabilityPointStructureEntities + .OrderBy(fpe => fpe.Order) + .Select(structureEntity => structureEntity.Read(collector)) + .ToArray(), + sourcePath); + } + } + + private static void ReadGeneralInput(this FailureMechanismEntity entity, GeneralStabilityPointStructuresInput generalInput) + { + GeneralStabilityPointStructuresInput generalStabilityPointStructuresInput = entity.StabilityPointStructuresFailureMechanismMetaEntities.First().Read(); + generalInput.N = generalStabilityPointStructuresInput.N; + } + + private static void ReadStabilityPointStructuresRootCalculationGroup(CalculationGroupEntity rootCalculationGroupEntity, + CalculationGroup targetRootCalculationGroup, + ReadConversionCollector collector) + { + CalculationGroup rootCalculationGroup = rootCalculationGroupEntity.ReadAsStabilityPointStructuresCalculationGroup(collector); + foreach (ICalculationBase calculationBase in rootCalculationGroup.Children) + { + targetRootCalculationGroup.Children.Add(calculationBase); + } + } + + #endregion + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/FailureMechanismSectionEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/FailureMechanismSectionEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/FailureMechanismSectionEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,60 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Geometry; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Serializers; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class FailureMechanismSectionEntityReadExtensions + { + /// + /// Read the and use the information to construct a . + /// + /// The to create for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + /// Thrown when + /// of is null or empty. + internal static FailureMechanismSection Read(this FailureMechanismSectionEntity entity, ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + Point2D[] points = new Point2DCollectionXmlSerializer().FromXml(entity.FailureMechanismSectionPointXml); + var mechanismSection = new FailureMechanismSection(entity.Name, points); + + collector.Read(entity, mechanismSection); + + return mechanismSection; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ForeshoreProfileEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ForeshoreProfileEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ForeshoreProfileEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,86 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Geometry; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Serializers; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class ForeshoreProfileEntityReadExtensions + { + /// + /// Read the and use the information to construct a . + /// + /// The to create for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + /// Thrown when + /// of is null or empty. + internal static ForeshoreProfile Read(this ForeshoreProfileEntity entity, ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (collector.Contains(entity)) + { + return collector.Get(entity); + } + + Point2D[] points = new Point2DCollectionXmlSerializer().FromXml(entity.GeometryXml); + + var foreshoreProfile = new ForeshoreProfile(new Point2D(entity.X.ToNullAsNaN(), entity.Y.ToNullAsNaN()), + points, + CreateBreakWater(entity.BreakWaterType, entity.BreakWaterHeight), + new ForeshoreProfile.ConstructionProperties + { + Id = entity.Id.DeepClone(), + Name = entity.Name.DeepClone(), + Orientation = entity.Orientation.ToNullAsNaN(), + X0 = entity.X0.ToNullAsNaN() + }); + + collector.Read(entity, foreshoreProfile); + + return foreshoreProfile; + } + + private static BreakWater CreateBreakWater(byte? breakWaterType, double? breakWaterHeight) + { + if (breakWaterType == null) + { + return null; + } + + return new BreakWater((BreakWaterType) breakWaterType.Value, breakWaterHeight.ToNullAsNaN()); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/DikeProfileEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/DikeProfileEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/DikeProfileEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,91 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Geometry; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Serializers; + +namespace Ringtoets.Storage.Core.Read.GrassCoverErosionInwards +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class DikeProfileEntityReadExtensions + { + /// + /// Reads the and use the information to update a + /// . + /// + /// The to create for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + /// Thrown when + /// or of is null or empty. + internal static DikeProfile Read(this DikeProfileEntity entity, ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (collector.Contains(entity)) + { + return collector.Get(entity); + } + + var dikeProfile = new DikeProfile(new Point2D(entity.X.ToNullAsNaN(), entity.Y.ToNullAsNaN()), + new RoughnessPointCollectionXmlSerializer().FromXml(entity.DikeGeometryXml), + new Point2DCollectionXmlSerializer().FromXml(entity.ForeshoreXml), + CreateBreakWater(entity), + CreateProperties(entity)); + + collector.Read(entity, dikeProfile); + + return dikeProfile; + } + + private static DikeProfile.ConstructionProperties CreateProperties(DikeProfileEntity entity) + { + return new DikeProfile.ConstructionProperties + { + Id = entity.Id, + Name = entity.Name, + Orientation = entity.Orientation.ToNullAsNaN(), + DikeHeight = entity.DikeHeight.ToNullAsNaN(), + X0 = entity.X0.ToNullAsNaN() + }; + } + + private static BreakWater CreateBreakWater(DikeProfileEntity entity) + { + if (entity.BreakWaterType == null || entity.BreakWaterHeight == null) + { + return null; + } + + return new BreakWater((BreakWaterType) entity.BreakWaterType, entity.BreakWaterHeight.Value); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,113 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Linq; +using Core.Common.Base.Data; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.GrassCoverErosionInwards +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class GrassCoverErosionInwardsCalculationEntityReadExtensions + { + /// + /// Reads the and use the + /// information to update a . + /// + /// The + /// to create for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + internal static GrassCoverErosionInwardsCalculation Read(this GrassCoverErosionInwardsCalculationEntity entity, ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (collector.Contains(entity)) + { + return collector.Get(entity); + } + + var calculation = new GrassCoverErosionInwardsCalculation + { + Name = entity.Name, + Comments = + { + Body = entity.Comments + } + }; + ReadInput(calculation.InputParameters, entity, collector); + ReadOutput(calculation, entity); + + collector.Read(entity, calculation); + + return calculation; + } + + private static void ReadInput(GrassCoverErosionInwardsInput inputParameters, GrassCoverErosionInwardsCalculationEntity entity, ReadConversionCollector collector) + { + inputParameters.DikeProfile = GetDikeProfileValue(entity.DikeProfileEntity, collector); + inputParameters.HydraulicBoundaryLocation = GetHydraulicBoundaryLocationValue(entity.HydraulicLocationEntity, collector); + inputParameters.Orientation = (RoundedDouble) entity.Orientation.ToNullAsNaN(); + inputParameters.CriticalFlowRate.Mean = (RoundedDouble) entity.CriticalFlowRateMean.ToNullAsNaN(); + inputParameters.CriticalFlowRate.StandardDeviation = (RoundedDouble) entity.CriticalFlowRateStandardDeviation.ToNullAsNaN(); + inputParameters.UseForeshore = Convert.ToBoolean(entity.UseForeshore); + inputParameters.DikeHeight = (RoundedDouble) entity.DikeHeight.ToNullAsNaN(); + inputParameters.UseBreakWater = Convert.ToBoolean(entity.UseBreakWater); + inputParameters.BreakWater.Height = (RoundedDouble) entity.BreakWaterHeight.ToNullAsNaN(); + inputParameters.BreakWater.Type = (BreakWaterType) entity.BreakWaterType; + inputParameters.DikeHeightCalculationType = (DikeHeightCalculationType) entity.DikeHeightCalculationType; + inputParameters.OvertoppingRateCalculationType = (OvertoppingRateCalculationType) entity.OvertoppingRateCalculationType; + inputParameters.ShouldOvertoppingOutputIllustrationPointsBeCalculated = Convert.ToBoolean(entity.ShouldOvertoppingOutputIllustrationPointsBeCalculated); + inputParameters.ShouldDikeHeightIllustrationPointsBeCalculated = Convert.ToBoolean(entity.ShouldDikeHeightIllustrationPointsBeCalculated); + inputParameters.ShouldOvertoppingRateIllustrationPointsBeCalculated = Convert.ToBoolean(entity.ShouldOvertoppingRateIllustrationPointsBeCalculated); + } + + private static void ReadOutput(GrassCoverErosionInwardsCalculation calculation, GrassCoverErosionInwardsCalculationEntity entity) + { + GrassCoverErosionInwardsOutputEntity output = entity.GrassCoverErosionInwardsOutputEntities.FirstOrDefault(); + if (output != null) + { + calculation.Output = output.Read(); + } + } + + private static DikeProfile GetDikeProfileValue(DikeProfileEntity dikeProfileEntity, ReadConversionCollector collector) + { + return dikeProfileEntity?.Read(collector); + } + + private static HydraulicBoundaryLocation GetHydraulicBoundaryLocationValue(HydraulicLocationEntity hydraulicLocationEntity, ReadConversionCollector collector) + { + return hydraulicLocationEntity?.Read(collector); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsDikeHeightOutputEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsDikeHeightOutputEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsDikeHeightOutputEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,61 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Read.IllustrationPoints; + +namespace Ringtoets.Storage.Core.Read.GrassCoverErosionInwards +{ + /// + /// Extension methods for + /// related to creating a . + /// + internal static class GrassCoverErosionInwardsDikeHeightOutputEntityReadExtensions + { + /// + /// Reads the and use + /// the information to construct a . + /// + /// The + /// to create for. + /// A new . + /// Thrown when + /// is null. + internal static DikeHeightOutput Read(this GrassCoverErosionInwardsDikeHeightOutputEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return new DikeHeightOutput(entity.DikeHeight.ToNullAsNaN(), + entity.TargetProbability.ToNullAsNaN(), + entity.TargetReliability.ToNullAsNaN(), + entity.CalculatedProbability.ToNullAsNaN(), + entity.CalculatedReliability.ToNullAsNaN(), + (CalculationConvergence) entity.CalculationConvergence, + entity.GeneralResultFaultTreeIllustrationPointEntity?.Read()); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismMetaEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismMetaEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismMetaEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,58 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.GrassCoverErosionInwards +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class GrassCoverErosionInwardsFailureMechanismMetaEntityReadExtensions + { + /// + /// Read the and use the information + /// to update the . + /// + /// The to use + /// to update the . + /// The to be updated. + /// Thrown when any input parameter is null. + internal static void Read(this GrassCoverErosionInwardsFailureMechanismMetaEntity entity, GeneralGrassCoverErosionInwardsInput input) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (input == null) + { + throw new ArgumentNullException(nameof(input)); + } + + input.N = (RoundedDouble) entity.N; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsOutputEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsOutputEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsOutputEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,77 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Linq; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Read.IllustrationPoints; + +namespace Ringtoets.Storage.Core.Read.GrassCoverErosionInwards +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class GrassCoverErosionInwardsOutputEntityReadExtensions + { + /// + /// Reads the + /// and use the information to construct a . + /// + /// The + /// to create for. + /// A new . + /// Thrown when + /// is null. + internal static GrassCoverErosionInwardsOutput Read(this GrassCoverErosionInwardsOutputEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return new GrassCoverErosionInwardsOutput(GetOvertoppingOutput(entity), + GetDikeHeightOutput(entity), + GetOvertoppingRateOutput(entity)); + } + + private static OvertoppingOutput GetOvertoppingOutput(GrassCoverErosionInwardsOutputEntity entity) + { + return new OvertoppingOutput(entity.WaveHeight.ToNullAsNaN(), + Convert.ToBoolean(entity.IsOvertoppingDominant), + entity.Reliability.ToNullAsNaN(), + entity.GeneralResultFaultTreeIllustrationPointEntity?.Read()); + } + + private static DikeHeightOutput GetDikeHeightOutput(GrassCoverErosionInwardsOutputEntity entity) + { + GrassCoverErosionInwardsDikeHeightOutputEntity dikeHeightOutputEntity = entity.GrassCoverErosionInwardsDikeHeightOutputEntities.FirstOrDefault(); + return dikeHeightOutputEntity?.Read(); + } + + private static OvertoppingRateOutput GetOvertoppingRateOutput(GrassCoverErosionInwardsOutputEntity entity) + { + GrassCoverErosionInwardsOvertoppingRateOutputEntity overtoppingRateOutputEntity = entity.GrassCoverErosionInwardsOvertoppingRateOutputEntities.FirstOrDefault(); + return overtoppingRateOutputEntity?.Read(); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsOvertoppingRateOutputEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsOvertoppingRateOutputEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsOvertoppingRateOutputEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,61 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Read.IllustrationPoints; + +namespace Ringtoets.Storage.Core.Read.GrassCoverErosionInwards +{ + /// + /// Extension methods for + /// related to creating a . + /// + internal static class GrassCoverErosionInwardsOvertoppingRateOutputEntityReadExtensions + { + /// + /// Reads the and use + /// the information to construct a . + /// + /// The + /// to create for. + /// A new . + /// Thrown when + /// is null. + internal static OvertoppingRateOutput Read(this GrassCoverErosionInwardsOvertoppingRateOutputEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return new OvertoppingRateOutput(entity.OvertoppingRate.ToNullAsNaN(), + entity.TargetProbability.ToNullAsNaN(), + entity.TargetReliability.ToNullAsNaN(), + entity.CalculatedProbability.ToNullAsNaN(), + entity.CalculatedReliability.ToNullAsNaN(), + (CalculationConvergence) entity.CalculationConvergence, + entity.GeneralResultFaultTreeIllustrationPointEntity?.Read()); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsSectionResultEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsSectionResultEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsSectionResultEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,76 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Primitives; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.GrassCoverErosionInwards +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class GrassCoverErosionInwardsSectionResultEntityReadExtensions + { + /// + /// Reads the and use the information to construct a + /// . + /// + /// The + /// used to update the . + /// The target of the read operation. + /// The object keeping track of read operations. + /// Thrown when any input parameter is null. + internal static void Read(this GrassCoverErosionInwardsSectionResultEntity entity, + GrassCoverErosionInwardsFailureMechanismSectionResult sectionResult, + ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (sectionResult == null) + { + throw new ArgumentNullException(nameof(sectionResult)); + } + + sectionResult.SimpleAssessmentResult = (SimpleAssessmentValidityOnlyResultType) entity.SimpleAssessmentResult; + sectionResult.DetailedAssessmentResult = (DetailedAssessmentProbabilityOnlyResultType) entity.DetailedAssessmentResult; + sectionResult.TailorMadeAssessmentResult = (TailorMadeAssessmentProbabilityCalculationResultType) entity.TailorMadeAssessmentResult; + sectionResult.TailorMadeAssessmentProbability = entity.TailorMadeAssessmentProbability.ToNullAsNaN(); + sectionResult.UseManualAssembly = Convert.ToBoolean(entity.UseManualAssembly); + sectionResult.ManualAssemblyProbability = entity.ManualAssemblyProbability.ToNullAsNaN(); + + if (entity.GrassCoverErosionInwardsCalculationEntity != null) + { + sectionResult.Calculation = entity.GrassCoverErosionInwardsCalculationEntity.Read(collector); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionOutwards/GrassCoverErosionInwardsFailureMechanismMetaEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionOutwards/GrassCoverErosionInwardsFailureMechanismMetaEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionOutwards/GrassCoverErosionInwardsFailureMechanismMetaEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,58 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using Ringtoets.GrassCoverErosionOutwards.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.GrassCoverErosionOutwards +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class GrassCoverErosionOutwardsFailureMechanismMetaEntityReadExtensions + { + /// + /// Read the and use the information + /// to update the . + /// + /// The to use + /// to update the . + /// The to be updated. + /// Thrown when any input parameter is null. + internal static void Read(this GrassCoverErosionOutwardsFailureMechanismMetaEntity entity, GeneralGrassCoverErosionOutwardsInput input) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (input == null) + { + throw new ArgumentNullException(nameof(input)); + } + + input.N = (RoundedDouble) entity.N; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsSectionResultEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsSectionResultEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsSectionResultEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,67 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.AssemblyTool.Data; +using Ringtoets.Common.Primitives; +using Ringtoets.GrassCoverErosionOutwards.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.GrassCoverErosionOutwards +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class GrassCoverErosionOutwardsSectionResultEntityReadExtensions + { + /// + /// Reads the and use the information to update a + /// . + /// + /// The used + /// to update the . + /// The target of the read operation. + /// Thrown when any parameter is null. + internal static void Read(this GrassCoverErosionOutwardsSectionResultEntity entity, GrassCoverErosionOutwardsFailureMechanismSectionResult sectionResult) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (sectionResult == null) + { + throw new ArgumentNullException(nameof(sectionResult)); + } + + sectionResult.SimpleAssessmentResult = (SimpleAssessmentResultType) entity.SimpleAssessmentResult; + sectionResult.DetailedAssessmentResultForFactorizedSignalingNorm = (DetailedAssessmentResultType) entity.DetailedAssessmentResultForFactorizedSignalingNorm; + sectionResult.DetailedAssessmentResultForSignalingNorm = (DetailedAssessmentResultType) entity.DetailedAssessmentResultForSignalingNorm; + sectionResult.DetailedAssessmentResultForMechanismSpecificLowerLimitNorm = (DetailedAssessmentResultType) entity.DetailedAssessmentResultForMechanismSpecificLowerLimitNorm; + sectionResult.DetailedAssessmentResultForLowerLimitNorm = (DetailedAssessmentResultType) entity.DetailedAssessmentResultForLowerLimitNorm; + sectionResult.DetailedAssessmentResultForFactorizedLowerLimitNorm = (DetailedAssessmentResultType) entity.DetailedAssessmentResultForFactorizedLowerLimitNorm; + sectionResult.TailorMadeAssessmentResult = (TailorMadeAssessmentCategoryGroupResultType) entity.TailorMadeAssessmentResult; + sectionResult.UseManualAssembly = Convert.ToBoolean(entity.UseManualAssembly); + sectionResult.ManualAssemblyCategoryGroup = (FailureMechanismSectionAssemblyCategoryGroup) entity.ManualAssemblyCategoryGroup; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsCalculationEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsCalculationEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsCalculationEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,126 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using Core.Common.Base.Data; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.GrassCoverErosionOutwards.Data; +using Ringtoets.Revetment.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.GrassCoverErosionOutwards +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class GrassCoverErosionOutwardsWaveConditionsCalculationEntityReadExtensions + { + /// + /// Reads the and use the + /// information to update a . + /// + /// The + /// to create for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when any parameter is null. + internal static GrassCoverErosionOutwardsWaveConditionsCalculation Read(this GrassCoverErosionOutwardsWaveConditionsCalculationEntity entity, + ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation + { + Name = entity.Name, + Comments = + { + Body = entity.Comments + } + }; + ReadCalculationInputs(calculation.InputParameters, entity, collector); + ReadCalculationOutputs(calculation, entity); + + return calculation; + } + + private static void ReadCalculationInputs(FailureMechanismCategoryWaveConditionsInput inputParameters, + GrassCoverErosionOutwardsWaveConditionsCalculationEntity entity, + ReadConversionCollector collector) + { + inputParameters.ForeshoreProfile = GetDikeProfileValue(entity.ForeshoreProfileEntity, collector); + inputParameters.HydraulicBoundaryLocation = GetHydraulicBoundaryLocationValue(entity.HydraulicLocationEntity, collector); + inputParameters.Orientation = (RoundedDouble) entity.Orientation.ToNullAsNaN(); + inputParameters.UseForeshore = Convert.ToBoolean(entity.UseForeshore); + inputParameters.UseBreakWater = Convert.ToBoolean(entity.UseBreakWater); + inputParameters.BreakWater.Height = (RoundedDouble) entity.BreakWaterHeight.ToNullAsNaN(); + inputParameters.BreakWater.Type = (BreakWaterType) entity.BreakWaterType; + inputParameters.UpperBoundaryRevetment = (RoundedDouble) entity.UpperBoundaryRevetment.ToNullAsNaN(); + inputParameters.LowerBoundaryRevetment = (RoundedDouble) entity.LowerBoundaryRevetment.ToNullAsNaN(); + inputParameters.UpperBoundaryWaterLevels = (RoundedDouble) entity.UpperBoundaryWaterLevels.ToNullAsNaN(); + inputParameters.LowerBoundaryWaterLevels = (RoundedDouble) entity.LowerBoundaryWaterLevels.ToNullAsNaN(); + inputParameters.StepSize = (WaveConditionsInputStepSize) entity.StepSize; + inputParameters.CategoryType = (FailureMechanismCategoryType) entity.CategoryType; + } + + private static void ReadCalculationOutputs(GrassCoverErosionOutwardsWaveConditionsCalculation calculation, + GrassCoverErosionOutwardsWaveConditionsCalculationEntity entity) + { + if (!entity.GrassCoverErosionOutwardsWaveConditionsOutputEntities.Any()) + { + return; + } + + List waveConditionsOutputs = entity.GrassCoverErosionOutwardsWaveConditionsOutputEntities + .OrderBy(e => e.Order) + .Select(e => e.Read()) + .ToList(); + calculation.Output = new GrassCoverErosionOutwardsWaveConditionsOutput(waveConditionsOutputs); + } + + private static ForeshoreProfile GetDikeProfileValue(ForeshoreProfileEntity foreshoreProfileEntity, + ReadConversionCollector collector) + { + return foreshoreProfileEntity?.Read(collector); + } + + private static HydraulicBoundaryLocation GetHydraulicBoundaryLocationValue( + HydraulicLocationEntity hydraulicLocationEntity, + ReadConversionCollector collector) + { + return hydraulicLocationEntity != null + ? collector.Get(hydraulicLocationEntity) + : null; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsOutputEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsOutputEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsOutputEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,56 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.GrassCoverErosionOutwards.Data; +using Ringtoets.Revetment.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.GrassCoverErosionOutwards +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class GrassCoverErosionOutwardsWaveConditionsOutputEntityReadExtensions + { + /// + /// Reads the + /// and use the information to construct a . + /// + /// The + /// to create for. + /// A new . + internal static WaveConditionsOutput Read(this GrassCoverErosionOutwardsWaveConditionsOutputEntity entity) + { + return new WaveConditionsOutput(entity.WaterLevel.ToNullAsNaN(), + entity.WaveHeight.ToNullAsNaN(), + entity.WavePeakPeriod.ToNullAsNaN(), + entity.WaveAngle.ToNullAsNaN(), + entity.WaveDirection.ToNullAsNaN(), + entity.TargetProbability.ToNullAsNaN(), + entity.TargetReliability.ToNullAsNaN(), + entity.CalculatedProbability.ToNullAsNaN(), + entity.CalculatedReliability.ToNullAsNaN(), + (CalculationConvergence) entity.CalculationConvergence); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverSlipOffInwardsSectionResultEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverSlipOffInwardsSectionResultEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverSlipOffInwardsSectionResultEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,61 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Primitives; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class GrassCoverSlipOffInwardsSectionResultEntityReadExtensions + { + /// + /// Reads the and use the information to update a + /// . + /// + /// The used to update . + /// The target of the read operation. + /// Thrown when any parameter is null. + internal static void Read(this GrassCoverSlipOffInwardsSectionResultEntity entity, GrassCoverSlipOffInwardsFailureMechanismSectionResult sectionResult) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (sectionResult == null) + { + throw new ArgumentNullException(nameof(sectionResult)); + } + + sectionResult.SimpleAssessmentResult = (SimpleAssessmentResultType) entity.SimpleAssessmentResult; + sectionResult.DetailedAssessmentResult = (DetailedAssessmentResultType) entity.DetailedAssessmentResult; + sectionResult.TailorMadeAssessmentResult = (TailorMadeAssessmentResultType) entity.TailorMadeAssessmentResult; + sectionResult.UseManualAssembly = Convert.ToBoolean(entity.UseManualAssembly); + sectionResult.ManualAssemblyCategoryGroup = (ManualFailureMechanismSectionAssemblyCategoryGroup) entity.ManualAssemblyCategoryGroup; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverSlipOffOutwardsSectionResultEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverSlipOffOutwardsSectionResultEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/GrassCoverSlipOffOutwardsSectionResultEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,61 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Primitives; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class GrassCoverSlipOffOutwardsSectionResultEntityReadExtensions + { + /// + /// Reads the and use the information to update a + /// . + /// + /// The used to update . + /// The target of the read operation. + /// Thrown when any parameter is null. + internal static void Read(this GrassCoverSlipOffOutwardsSectionResultEntity entity, GrassCoverSlipOffOutwardsFailureMechanismSectionResult sectionResult) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (sectionResult == null) + { + throw new ArgumentNullException(nameof(sectionResult)); + } + + sectionResult.SimpleAssessmentResult = (SimpleAssessmentResultType) entity.SimpleAssessmentResult; + sectionResult.DetailedAssessmentResult = (DetailedAssessmentResultType) entity.DetailedAssessmentResult; + sectionResult.TailorMadeAssessmentResult = (TailorMadeAssessmentResultType) entity.TailorMadeAssessmentResult; + sectionResult.UseManualAssembly = Convert.ToBoolean(entity.UseManualAssembly); + sectionResult.ManualAssemblyCategoryGroup = (ManualFailureMechanismSectionAssemblyCategoryGroup) entity.ManualAssemblyCategoryGroup; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HeightStructures/HeightStructureEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HeightStructures/HeightStructureEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HeightStructures/HeightStructureEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,100 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using Core.Common.Base.Geometry; +using Ringtoets.HeightStructures.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.HeightStructures +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class HeightStructureEntityReadExtensions + { + /// + /// Reads the and use the information to update a + /// . + /// + /// The to create for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + internal static HeightStructure Read(this HeightStructureEntity entity, ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (collector.Contains(entity)) + { + return collector.Get(entity); + } + + var structure = new HeightStructure(new HeightStructure.ConstructionProperties + { + Name = entity.Name, + Id = entity.Id, + Location = new Point2D(entity.X.ToNullAsNaN(), entity.Y.ToNullAsNaN()), + StructureNormalOrientation = (RoundedDouble) entity.StructureNormalOrientation.ToNullAsNaN(), + LevelCrestStructure = + { + Mean = (RoundedDouble) entity.LevelCrestStructureMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.LevelCrestStructureStandardDeviation.ToNullAsNaN() + }, + FlowWidthAtBottomProtection = + { + Mean = (RoundedDouble) entity.FlowWidthAtBottomProtectionMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.FlowWidthAtBottomProtectionStandardDeviation.ToNullAsNaN() + }, + CriticalOvertoppingDischarge = + { + Mean = (RoundedDouble) entity.CriticalOvertoppingDischargeMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.CriticalOvertoppingDischargeCoefficientOfVariation.ToNullAsNaN() + }, + WidthFlowApertures = + { + Mean = (RoundedDouble) entity.WidthFlowAperturesMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.WidthFlowAperturesStandardDeviation.ToNullAsNaN() + }, + FailureProbabilityStructureWithErosion = entity.FailureProbabilityStructureWithErosion.ToNullAsNaN(), + StorageStructureArea = + { + Mean = (RoundedDouble) entity.StorageStructureAreaMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.StorageStructureAreaCoefficientOfVariation.ToNullAsNaN() + }, + AllowedLevelIncreaseStorage = + { + Mean = (RoundedDouble) entity.AllowedLevelIncreaseStorageMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.AllowedLevelIncreaseStorageStandardDeviation.ToNullAsNaN() + } + }); + + collector.Read(entity, structure); + + return structure; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HeightStructures/HeightStructuresCalculationEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HeightStructures/HeightStructuresCalculationEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HeightStructures/HeightStructuresCalculationEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,107 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Linq; +using Core.Common.Base.Data; +using Ringtoets.Common.Data.Structures; +using Ringtoets.HeightStructures.Data; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Read.IllustrationPoints; + +namespace Ringtoets.Storage.Core.Read.HeightStructures +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class HeightStructuresCalculationEntityReadExtensions + { + /// + /// Reads the and use the + /// information to update a . + /// + /// The + /// to create for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + internal static StructuresCalculation Read(this HeightStructuresCalculationEntity entity, + ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (collector.Contains(entity)) + { + return collector.Get(entity); + } + + var calculation = new StructuresCalculation + { + Name = entity.Name, + Comments = + { + Body = entity.Comments + } + }; + ReadInputParameters(calculation.InputParameters, entity, collector); + ReadOutput(calculation, entity); + + collector.Read(entity, calculation); + + return calculation; + } + + private static void ReadInputParameters(HeightStructuresInput inputParameters, + HeightStructuresCalculationEntity entity, + ReadConversionCollector collector) + { + if (entity.HeightStructureEntity != null) + { + inputParameters.Structure = entity.HeightStructureEntity.Read(collector); + } + + entity.Read(inputParameters, collector); + + inputParameters.DeviationWaveDirection = (RoundedDouble) entity.DeviationWaveDirection.ToNullAsNaN(); + inputParameters.ModelFactorSuperCriticalFlow.Mean = (RoundedDouble) entity.ModelFactorSuperCriticalFlowMean.ToNullAsNaN(); + inputParameters.LevelCrestStructure.Mean = (RoundedDouble) entity.LevelCrestStructureMean.ToNullAsNaN(); + inputParameters.LevelCrestStructure.StandardDeviation = (RoundedDouble) entity.LevelCrestStructureStandardDeviation.ToNullAsNaN(); + } + + private static void ReadOutput(StructuresCalculation calculation, + HeightStructuresCalculationEntity entity) + { + HeightStructuresOutputEntity outputEntity = entity.HeightStructuresOutputEntities.FirstOrDefault(); + if (outputEntity == null) + { + return; + } + + var output = new StructuresOutput(outputEntity.Reliability.ToNullAsNaN(), + outputEntity.GeneralResultFaultTreeIllustrationPointEntity?.Read()); + calculation.Output = output; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HeightStructures/HeightStructuresFailureMechanismMetaEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HeightStructures/HeightStructuresFailureMechanismMetaEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HeightStructures/HeightStructuresFailureMechanismMetaEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,56 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using Ringtoets.HeightStructures.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.HeightStructures +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class HeightStructuresFailureMechanismMetaEntityReadExtensions + { + /// + /// Read the and use the information to + /// construct a . + /// + /// The to create + /// for. + /// A new . + /// Thrown when is null. + internal static GeneralHeightStructuresInput Read(this HeightStructuresFailureMechanismMetaEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return new GeneralHeightStructuresInput + { + N = (RoundedDouble) entity.N + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HeightStructures/HeightStructuresSectionResultEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HeightStructures/HeightStructuresSectionResultEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HeightStructures/HeightStructuresSectionResultEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,77 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Primitives; +using Ringtoets.HeightStructures.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.HeightStructures +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class HeightStructuresSectionResultEntityReadExtensions + { + /// + /// Reads the and use the information + /// to update a . + /// + /// The used to + /// update the . + /// The target of the read operation. + /// The object keeping track of read operations. + /// A new . + /// Thrown when any input parameter is null. + internal static void Read(this HeightStructuresSectionResultEntity entity, + HeightStructuresFailureMechanismSectionResult sectionResult, + ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (sectionResult == null) + { + throw new ArgumentNullException(nameof(sectionResult)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + sectionResult.SimpleAssessmentResult = (SimpleAssessmentResultType) entity.SimpleAssessmentResult; + sectionResult.DetailedAssessmentResult = (DetailedAssessmentProbabilityOnlyResultType) entity.DetailedAssessmentResult; + sectionResult.TailorMadeAssessmentResult = (TailorMadeAssessmentProbabilityCalculationResultType) entity.TailorMadeAssessmentResult; + sectionResult.TailorMadeAssessmentProbability = entity.TailorMadeAssessmentProbability.ToNullAsNaN(); + sectionResult.UseManualAssembly = Convert.ToBoolean(entity.UseManualAssembly); + sectionResult.ManualAssemblyProbability = entity.ManualAssemblyProbability.ToNullAsNaN(); + + if (entity.HeightStructuresCalculationEntity != null) + { + sectionResult.Calculation = entity.HeightStructuresCalculationEntity.Read(collector); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HydraulicBoundaryDatabaseEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HydraulicBoundaryDatabaseEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HydraulicBoundaryDatabaseEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,68 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// This class defines extension methods for read operations for a . + /// + internal static class HydraulicBoundaryDatabaseEntityReadExtensions + { + /// + /// Reads the and uses the information to + /// update a . + /// + /// The to update the + /// . + /// The to update. + /// Thrown when any parameter is null. + internal static void Read(this HydraulicBoundaryDatabaseEntity entity, HydraulicBoundaryDatabase hydraulicBoundaryDatabase) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (hydraulicBoundaryDatabase == null) + { + throw new ArgumentNullException(nameof(hydraulicBoundaryDatabase)); + } + + hydraulicBoundaryDatabase.FilePath = entity.FilePath; + hydraulicBoundaryDatabase.Version = entity.Version; + + hydraulicBoundaryDatabase.HydraulicLocationConfigurationSettings.SetValues(entity.HydraulicLocationConfigurationSettingsFilePath, + entity.HydraulicLocationConfigurationSettingsScenarioName, + entity.HydraulicLocationConfigurationSettingsYear, + entity.HydraulicLocationConfigurationSettingsScope, + entity.HydraulicLocationConfigurationSettingsSeaLevel, + entity.HydraulicLocationConfigurationSettingsRiverDischarge, + entity.HydraulicLocationConfigurationSettingsLakeLevel, + entity.HydraulicLocationConfigurationSettingsWindDirection, + entity.HydraulicLocationConfigurationSettingsWindSpeed, + entity.HydraulicLocationConfigurationSettingsComment); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HydraulicLocationCalculationCollectionReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HydraulicLocationCalculationCollectionReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HydraulicLocationCalculationCollectionReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,76 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// This class defines extension methods for read operations for a collection of + /// based on the . + /// + internal static class HydraulicLocationCalculationCollectionReadExtensions + { + /// + /// Reads the and uses + /// the information to update a collection of . + /// + /// The to update the + /// . + /// The target of the read operation. + /// The object keeping track of the read operations. + /// Thrown when any parameter is null. + internal static void Read(this HydraulicLocationCalculationCollectionEntity entity, + IEnumerable calculations, + ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (calculations == null) + { + throw new ArgumentNullException(nameof(calculations)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + Dictionary calculationsLookup = + calculations.ToDictionary(calc => calc.HydraulicBoundaryLocation, calc => calc); + + foreach (HydraulicLocationCalculationEntity calculationEntity in entity.HydraulicLocationCalculationEntities) + { + HydraulicBoundaryLocation hydraulicBoundaryLocation = collector.Get(calculationEntity.HydraulicLocationEntity); + HydraulicBoundaryLocationCalculation calculation = calculationsLookup[hydraulicBoundaryLocation]; + + calculationEntity.Read(calculation); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HydraulicLocationCalculationEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HydraulicLocationCalculationEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HydraulicLocationCalculationEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,64 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Linq; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class HydraulicLocationCalculationEntityReadExtensions + { + /// + /// Reads the and uses the information to update a + /// . + /// + /// The to update the + /// . + /// The target of the read operation. + /// Thrown when any parameter is null. + internal static void Read(this HydraulicLocationCalculationEntity entity, + HydraulicBoundaryLocationCalculation calculation) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (calculation == null) + { + throw new ArgumentNullException(nameof(calculation)); + } + + calculation.InputParameters.ShouldIllustrationPointsBeCalculated = Convert.ToBoolean(entity.ShouldIllustrationPointsBeCalculated); + HydraulicLocationOutputEntity outputEntity = entity.HydraulicLocationOutputEntities.SingleOrDefault(); + if (outputEntity != null) + { + calculation.Output = outputEntity.Read(); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HydraulicLocationEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HydraulicLocationEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HydraulicLocationEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,68 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class HydraulicLocationEntityReadExtensions + { + /// + /// Read the and use the information to construct a . + /// + /// The to create for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when any input parameter is null. + internal static HydraulicBoundaryLocation Read(this HydraulicLocationEntity entity, ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (collector.Contains(entity)) + { + return collector.Get(entity); + } + + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(entity.LocationId, + entity.Name, + entity.LocationX.ToNullAsNaN(), + entity.LocationY.ToNullAsNaN()); + + collector.Read(entity, hydraulicBoundaryLocation); + + return hydraulicBoundaryLocation; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HydraulicLocationOutputEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HydraulicLocationOutputEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/HydraulicLocationOutputEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,57 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Read.IllustrationPoints; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// Extension methods for related to creating + /// a . + /// + internal static class HydraulicLocationOutputEntityReadExtensions + { + /// + /// Read the and use the information to construct a . + /// + /// The to create for. + /// A new . + /// Thrown when is null. + internal static HydraulicBoundaryLocationCalculationOutput Read(this HydraulicLocationOutputEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return new HydraulicBoundaryLocationCalculationOutput(entity.Result.ToNullAsNaN(), + entity.TargetProbability.ToNullAsNaN(), + entity.TargetReliability.ToNullAsNaN(), + entity.CalculatedProbability.ToNullAsNaN(), + entity.CalculatedReliability.ToNullAsNaN(), + (CalculationConvergence) entity.CalculationConvergence, + entity.GeneralResultSubMechanismIllustrationPointEntity?.Read()); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/FaultTreeIllustrationPointEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/FaultTreeIllustrationPointEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/FaultTreeIllustrationPointEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,119 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.IllustrationPoints +{ + /// + /// Extension methods for + /// related to creating a . + /// + internal static class FaultTreeIllustrationPointEntityReadExtensions + { + /// + /// Reads the and uses + /// the information to construct a . + /// + /// The + /// to create a for. + /// A new . + /// Thrown when + /// is null. + public static IllustrationPointNode Read(this FaultTreeIllustrationPointEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + var node = new IllustrationPointNode(GetFaultTreeIllustrationPoint(entity)); + + node.SetChildren(GetChildren(entity).ToArray()); + + return node; + } + + private static IEnumerable GetChildren(FaultTreeIllustrationPointEntity entity) + { + foreach (object childEntity in GetChildEntitiesInOrder(entity)) + { + var faultTreeIllustrationPointEntity = childEntity as FaultTreeIllustrationPointEntity; + if (faultTreeIllustrationPointEntity != null) + { + yield return faultTreeIllustrationPointEntity.Read(); + } + + var subMechanismIllustrationPointEntity = childEntity as SubMechanismIllustrationPointEntity; + if (subMechanismIllustrationPointEntity != null) + { + yield return new IllustrationPointNode(subMechanismIllustrationPointEntity.Read()); + } + } + } + + private static IEnumerable GetChildEntitiesInOrder(FaultTreeIllustrationPointEntity entity) + { + var sortedList = new SortedList(); + + foreach (FaultTreeIllustrationPointEntity childEntity in entity.FaultTreeIllustrationPointEntity1 + .OrderBy(ip => ip.Order)) + { + sortedList.Add(childEntity.Order, childEntity); + } + + foreach (SubMechanismIllustrationPointEntity childEntity in entity.SubMechanismIllustrationPointEntities + .OrderBy(ip => ip.Order)) + { + sortedList.Add(childEntity.Order, childEntity); + } + + return sortedList.Values; + } + + private static FaultTreeIllustrationPoint GetFaultTreeIllustrationPoint(FaultTreeIllustrationPointEntity entity) + { + IEnumerable stochasts = GetReadStochasts(entity.StochastEntities); + + return new FaultTreeIllustrationPoint(entity.Name, + entity.Beta, + stochasts, + GetCombinationType(entity)); + } + + private static CombinationType GetCombinationType(FaultTreeIllustrationPointEntity entity) + { + return (CombinationType) entity.CombinationType; + } + + private static IEnumerable GetReadStochasts(IEnumerable stochastEntities) + { + return stochastEntities.OrderBy(st => st.Order) + .Select(st => st.Read()) + .ToArray(); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/GeneralResultFaultTreeIllustrationPointEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/GeneralResultFaultTreeIllustrationPointEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/GeneralResultFaultTreeIllustrationPointEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,86 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.IllustrationPoints +{ + /// + /// Extension methods for + /// related to creating a for fault tree illustration point. + /// + internal static class GeneralResultFaultTreeIllustrationPointEntityReadExtensions + { + /// + /// Reads the and uses + /// the information to construct a . + /// + /// The + /// to create a for. + /// A new . + /// Thrown when is + /// null. + public static GeneralResult Read( + this GeneralResultFaultTreeIllustrationPointEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + WindDirection governingWindDirection = GetGoverningWindDirection(entity); + + IEnumerable stochasts = GetReadStochasts(entity.StochastEntities); + + IEnumerable topLevelIllustrationPoints = + GetReadTopLevelFaultTreeIllustrationPoint(entity.TopLevelFaultTreeIllustrationPointEntities); + + return new GeneralResult(governingWindDirection, + stochasts, + topLevelIllustrationPoints); + } + + private static WindDirection GetGoverningWindDirection(IGeneralResultEntity entity) + { + return new WindDirection(entity.GoverningWindDirectionName, + entity.GoverningWindDirectionAngle); + } + + private static IEnumerable GetReadStochasts(IEnumerable stochastEntities) + { + return stochastEntities.OrderBy(st => st.Order) + .Select(st => st.Read()) + .ToArray(); + } + + private static IEnumerable GetReadTopLevelFaultTreeIllustrationPoint( + IEnumerable topLevelIllustrationPointEntities) + { + return topLevelIllustrationPointEntities.OrderBy(ip => ip.Order) + .Select(ip => ip.Read()) + .ToArray(); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/GeneralResultSubMechanismIllustrationPointEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/GeneralResultSubMechanismIllustrationPointEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/GeneralResultSubMechanismIllustrationPointEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,87 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.IllustrationPoints +{ + /// + /// Extension methods for + /// related to creating a for top level sub + /// mechanism illustration point. + /// + internal static class GeneralResultSubMechanismIllustrationPointEntityReadExtensions + { + /// + /// Reads the and uses + /// the information to construct a . + /// + /// The + /// to create a for. + /// A new . + /// Thrown when + /// is null. + public static GeneralResult Read( + this GeneralResultSubMechanismIllustrationPointEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + WindDirection governingWindDirection = GetGoverningWindDirection(entity); + + IEnumerable stochasts = GetReadStochasts(entity.StochastEntities); + + IEnumerable topLevelIllustrationPoints = + GetReadTopLevelSubMechanismIllustrationPoint(entity.TopLevelSubMechanismIllustrationPointEntities); + + return new GeneralResult(governingWindDirection, + stochasts, + topLevelIllustrationPoints); + } + + private static WindDirection GetGoverningWindDirection(IGeneralResultEntity entity) + { + return new WindDirection(entity.GoverningWindDirectionName, + entity.GoverningWindDirectionAngle); + } + + private static IEnumerable GetReadStochasts(IEnumerable stochastEntities) + { + return stochastEntities.OrderBy(st => st.Order) + .Select(st => st.Read()) + .ToArray(); + } + + private static IEnumerable GetReadTopLevelSubMechanismIllustrationPoint( + IEnumerable topLevelIllustrationPointEntities) + { + return topLevelIllustrationPointEntities.OrderBy(ip => ip.Order) + .Select(ip => ip.Read()) + .ToArray(); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/IllustrationPointResultEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/IllustrationPointResultEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/IllustrationPointResultEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,53 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.IllustrationPoints +{ + /// + /// Extension methods for related to creating an + /// . + /// + internal static class IllustrationPointResultEntityReadExtensions + { + /// + /// Reads the and uses the information to + /// construct an . + /// + /// The to create + /// a for. + /// A new . + /// Thrown when is null. + internal static IllustrationPointResult Read(this IllustrationPointResultEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return new IllustrationPointResult(entity.Description, + entity.Value); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/StochastEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/StochastEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/StochastEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,51 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.IllustrationPoints +{ + /// + /// Extension methods for related to creating a . + /// + internal static class StochastEntityReadExtensions + { + /// + /// Reads the and uses the information to construct a . + /// + /// The to create for. + /// A new . + /// Thrown when is null. + internal static Stochast Read(this StochastEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return new Stochast(entity.Name, + entity.Duration, + entity.Alpha); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/SubMechanismIllustrationPointEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/SubMechanismIllustrationPointEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/SubMechanismIllustrationPointEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,80 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.IllustrationPoints +{ + /// + /// Extension methods for + /// related to creating a . + /// + internal static class SubMechanismIllustrationPointEntityReadExtensions + { + /// + /// Reads the and uses + /// the information to construct a . + /// + /// The + /// to create a for. + /// A new . + /// Thrown when + /// is null. + internal static SubMechanismIllustrationPoint Read(this SubMechanismIllustrationPointEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + IEnumerable stochasts = + GetReadSubMechanismIllustrationPointStochasts(entity.SubMechanismIllustrationPointStochastEntities); + + IEnumerable illustrationPointResults = + GetReadIllustrationPointResults(entity.IllustrationPointResultEntities); + + return new SubMechanismIllustrationPoint(entity.Name, + entity.Beta, + stochasts, + illustrationPointResults); + } + + private static IEnumerable GetReadSubMechanismIllustrationPointStochasts( + IEnumerable stochastEntities) + { + return stochastEntities.OrderBy(st => st.Order) + .Select(st => st.Read()) + .ToArray(); + } + + private static IEnumerable GetReadIllustrationPointResults( + IEnumerable illustrationPointResultEntities) + { + return illustrationPointResultEntities.OrderBy(ipr => ipr.Order) + .Select(ipr => ipr.Read()) + .ToArray(); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/SubMechanismIllustrationPointStochastEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/SubMechanismIllustrationPointStochastEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/SubMechanismIllustrationPointStochastEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,55 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.IllustrationPoints +{ + /// + /// Extension methods for + /// related to creating a . + /// + internal static class SubMechanismIllustrationPointStochastEntityReadExtensions + { + /// + /// Reads the + /// and use the information to construct a . + /// + /// The to create + /// a for. + /// A new . + /// Thrown when is null. + internal static SubMechanismIllustrationPointStochast Read(this SubMechanismIllustrationPointStochastEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return new SubMechanismIllustrationPointStochast(entity.Name, + entity.Duration, + entity.Alpha, + entity.Realization); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/TopLevelFaultTreeIllustrationPointEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/TopLevelFaultTreeIllustrationPointEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/TopLevelFaultTreeIllustrationPointEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,63 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.IllustrationPoints +{ + /// + /// Extension methods for + /// related to creating a . + /// + internal static class TopLevelFaultTreeIllustrationPointEntityReadExtensions + { + /// + /// Reads the and + /// uses the information to construct a . + /// + /// The + /// to create a for. + /// A new . + /// Thrown when + /// is null. + public static TopLevelFaultTreeIllustrationPoint Read(this TopLevelFaultTreeIllustrationPointEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + WindDirection windDirection = GetWindDirection(entity); + + IllustrationPointNode node = entity.FaultTreeIllustrationPointEntity.Read(); + + return new TopLevelFaultTreeIllustrationPoint(windDirection, entity.ClosingSituation, node); + } + + private static WindDirection GetWindDirection(TopLevelFaultTreeIllustrationPointEntity entity) + { + return new WindDirection(entity.WindDirectionName, + entity.WindDirectionAngle); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/TopLevelSubMechanismIllustrationPointReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/TopLevelSubMechanismIllustrationPointReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/IllustrationPoints/TopLevelSubMechanismIllustrationPointReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,66 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.IllustrationPoints +{ + /// + /// Extension methods for + /// related to creating a . + /// + internal static class TopLevelSubMechanismIllustrationPointReadExtensions + { + /// + /// Reads the and + /// uses the information to construct a . + /// + /// The + /// to create a for. + /// A new . + /// Thrown when + /// is null. + internal static TopLevelSubMechanismIllustrationPoint Read(this TopLevelSubMechanismIllustrationPointEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + WindDirection windDirection = GetWindDirection(entity); + + SubMechanismIllustrationPoint subMechanismIllustrationPoint = + entity.SubMechanismIllustrationPointEntity.Read(); + + return new TopLevelSubMechanismIllustrationPoint(windDirection, + entity.ClosingSituation, + subMechanismIllustrationPoint); + } + + private static WindDirection GetWindDirection(TopLevelSubMechanismIllustrationPointEntity entity) + { + return new WindDirection(entity.WindDirectionName, + entity.WindDirectionAngle); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsCalculationEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsCalculationEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsCalculationEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,210 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Linq; +using Core.Common.Base.Data; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.MacroStabilityInwards.Primitives; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.MacroStabilityInwards +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class MacroStabilityInwardsCalculationEntityReadExtensions + { + /// + /// Read the and use the information to + /// construct a . + /// + /// The to create + /// for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + public static MacroStabilityInwardsCalculationScenario Read(this MacroStabilityInwardsCalculationEntity entity, + ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + var calculationScenario = new MacroStabilityInwardsCalculationScenario + { + Name = entity.Name, + IsRelevant = Convert.ToBoolean(entity.RelevantForScenario), + Contribution = (RoundedDouble) entity.ScenarioContribution.ToNullAsNaN(), + Comments = + { + Body = entity.Comment + } + }; + SetInputParameters(calculationScenario.InputParameters, entity, collector); + SetCalculationOutputsToScenario(calculationScenario, entity); + + return calculationScenario; + } + + private static void SetCalculationOutputsToScenario(MacroStabilityInwardsCalculationScenario calculationScenario, + MacroStabilityInwardsCalculationEntity entity) + { + MacroStabilityInwardsCalculationOutputEntity outputEntity = entity.MacroStabilityInwardsCalculationOutputEntities.FirstOrDefault(); + if (outputEntity != null) + { + calculationScenario.Output = outputEntity.Read(); + } + } + + private static void SetInputParameters(MacroStabilityInwardsInput inputParameters, + MacroStabilityInwardsCalculationEntity entity, + ReadConversionCollector collector) + { + SetHydraulicBoundaryLocationPropertiesToInput(inputParameters, entity, collector); + SetSurfaceLineToInput(inputParameters, entity, collector); + SetStochasticSoilModelToInput(inputParameters, entity, collector); + + inputParameters.SlipPlaneMinimumLength = (RoundedDouble) entity.SlipPlaneMinimumLength.ToNullAsNaN(); + inputParameters.SlipPlaneMinimumDepth = (RoundedDouble) entity.SlipPlaneMinimumDepth.ToNullAsNaN(); + inputParameters.MaximumSliceWidth = (RoundedDouble) entity.MaximumSliceWidth.ToNullAsNaN(); + + inputParameters.MoveGrid = Convert.ToBoolean(entity.MoveGrid); + inputParameters.DikeSoilScenario = (MacroStabilityInwardsDikeSoilScenario) entity.DikeSoilScenario; + + inputParameters.WaterLevelRiverAverage = (RoundedDouble) entity.WaterLevelRiverAverage.ToNullAsNaN(); + + inputParameters.DrainageConstructionPresent = Convert.ToBoolean(entity.DrainageConstructionPresent); + inputParameters.XCoordinateDrainageConstruction = (RoundedDouble) entity.DrainageConstructionCoordinateX.ToNullAsNaN(); + inputParameters.ZCoordinateDrainageConstruction = (RoundedDouble) entity.DrainageConstructionCoordinateZ.ToNullAsNaN(); + + inputParameters.MinimumLevelPhreaticLineAtDikeTopRiver = (RoundedDouble) entity.MinimumLevelPhreaticLineAtDikeTopRiver.ToNullAsNaN(); + inputParameters.MinimumLevelPhreaticLineAtDikeTopPolder = (RoundedDouble) entity.MinimumLevelPhreaticLineAtDikeTopPolder.ToNullAsNaN(); + + SetLocationInputExtremeToInput(inputParameters.LocationInputExtreme, entity); + SetLocationInputDailyToInput(inputParameters.LocationInputDaily, entity); + + inputParameters.AdjustPhreaticLine3And4ForUplift = Convert.ToBoolean(entity.AdjustPhreaticLine3And4ForUplift); + inputParameters.LeakageLengthOutwardsPhreaticLine4 = (RoundedDouble) entity.LeakageLengthOutwardsPhreaticLine4.ToNullAsNaN(); + inputParameters.LeakageLengthInwardsPhreaticLine4 = (RoundedDouble) entity.LeakageLengthInwardsPhreaticLine4.ToNullAsNaN(); + inputParameters.LeakageLengthOutwardsPhreaticLine3 = (RoundedDouble) entity.LeakageLengthOutwardsPhreaticLine3.ToNullAsNaN(); + inputParameters.LeakageLengthInwardsPhreaticLine3 = (RoundedDouble) entity.LeakageLengthInwardsPhreaticLine3.ToNullAsNaN(); + inputParameters.PiezometricHeadPhreaticLine2Outwards = (RoundedDouble) entity.PiezometricHeadPhreaticLine2Outwards.ToNullAsNaN(); + inputParameters.PiezometricHeadPhreaticLine2Inwards = (RoundedDouble) entity.PiezometricHeadPhreaticLine2Inwards.ToNullAsNaN(); + + inputParameters.GridDeterminationType = (MacroStabilityInwardsGridDeterminationType) entity.GridDeterminationType; + inputParameters.TangentLineDeterminationType = (MacroStabilityInwardsTangentLineDeterminationType) entity.TangentLineDeterminationType; + + inputParameters.TangentLineZTop = (RoundedDouble) entity.TangentLineZTop.ToNullAsNaN(); + inputParameters.TangentLineZBottom = (RoundedDouble) entity.TangentLineZBottom.ToNullAsNaN(); + inputParameters.TangentLineNumber = entity.TangentLineNumber; + + SetGridparametersToInput(inputParameters.LeftGrid, inputParameters.RightGrid, entity); + + inputParameters.CreateZones = Convert.ToBoolean(entity.CreateZones); + inputParameters.ZoningBoundariesDeterminationType = (MacroStabilityInwardsZoningBoundariesDeterminationType) entity.ZoningBoundariesDeterminationType; + inputParameters.ZoneBoundaryLeft = (RoundedDouble) entity.ZoneBoundaryLeft.ToNullAsNaN(); + inputParameters.ZoneBoundaryRight = (RoundedDouble) entity.ZoneBoundaryRight.ToNullAsNaN(); + } + + private static void SetSurfaceLineToInput(MacroStabilityInwardsInput inputParameters, + MacroStabilityInwardsCalculationEntity entity, + ReadConversionCollector collector) + { + if (entity.SurfaceLineEntity != null) + { + inputParameters.SurfaceLine = entity.SurfaceLineEntity.ReadAsMacroStabilityInwardsSurfaceLine(collector); + } + } + + private static void SetHydraulicBoundaryLocationPropertiesToInput(MacroStabilityInwardsInput inputParameters, + MacroStabilityInwardsCalculationEntity entity, + ReadConversionCollector collector) + { + inputParameters.UseAssessmentLevelManualInput = Convert.ToBoolean(entity.UseAssessmentLevelManualInput); + inputParameters.AssessmentLevel = (RoundedDouble) entity.AssessmentLevel.ToNullAsNaN(); + + if (entity.HydraulicLocationEntity != null) + { + inputParameters.HydraulicBoundaryLocation = entity.HydraulicLocationEntity.Read(collector); + } + } + + private static void SetStochasticSoilModelToInput(MacroStabilityInwardsInput inputParameters, + MacroStabilityInwardsCalculationEntity entity, + ReadConversionCollector collector) + { + if (entity.MacroStabilityInwardsStochasticSoilProfileEntity != null) + { + inputParameters.StochasticSoilModel = entity.MacroStabilityInwardsStochasticSoilProfileEntity + .StochasticSoilModelEntity + .ReadAsMacroStabilityInwardsStochasticSoilModel(collector); + inputParameters.StochasticSoilProfile = entity.MacroStabilityInwardsStochasticSoilProfileEntity.Read(collector); + } + } + + private static void SetLocationInputDailyToInput(IMacroStabilityInwardsLocationInputDaily inputDaily, + MacroStabilityInwardsCalculationEntity entity) + { + inputDaily.WaterLevelPolder = (RoundedDouble) entity.LocationInputDailyWaterLevelPolder.ToNullAsNaN(); + inputDaily.UseDefaultOffsets = Convert.ToBoolean(entity.LocationInputDailyUseDefaultOffsets); + + inputDaily.PhreaticLineOffsetBelowDikeTopAtRiver = (RoundedDouble) entity.LocationInputDailyPhreaticLineOffsetBelowDikeTopAtRiver.ToNullAsNaN(); + inputDaily.PhreaticLineOffsetBelowDikeTopAtPolder = (RoundedDouble) entity.LocationInputDailyPhreaticLineOffsetBelowDikeTopAtPolder.ToNullAsNaN(); + inputDaily.PhreaticLineOffsetBelowShoulderBaseInside = (RoundedDouble) entity.LocationInputDailyPhreaticLineOffsetBelowShoulderBaseInside.ToNullAsNaN(); + inputDaily.PhreaticLineOffsetBelowDikeToeAtPolder = (RoundedDouble) entity.LocationInputDailyPhreaticLineOffsetDikeToeAtPolder.ToNullAsNaN(); + } + + private static void SetLocationInputExtremeToInput(IMacroStabilityInwardsLocationInputExtreme inputExtreme, + MacroStabilityInwardsCalculationEntity entity) + { + inputExtreme.WaterLevelPolder = (RoundedDouble) entity.LocationInputExtremeWaterLevelPolder.ToNullAsNaN(); + inputExtreme.UseDefaultOffsets = Convert.ToBoolean(entity.LocationInputExtremeUseDefaultOffsets); + + inputExtreme.PhreaticLineOffsetBelowDikeTopAtRiver = (RoundedDouble) entity.LocationInputExtremePhreaticLineOffsetBelowDikeTopAtRiver.ToNullAsNaN(); + inputExtreme.PhreaticLineOffsetBelowDikeTopAtPolder = (RoundedDouble) entity.LocationInputExtremePhreaticLineOffsetBelowDikeTopAtPolder.ToNullAsNaN(); + inputExtreme.PhreaticLineOffsetBelowShoulderBaseInside = (RoundedDouble) entity.LocationInputExtremePhreaticLineOffsetBelowShoulderBaseInside.ToNullAsNaN(); + inputExtreme.PhreaticLineOffsetBelowDikeToeAtPolder = (RoundedDouble) entity.LocationInputExtremePhreaticLineOffsetDikeToeAtPolder.ToNullAsNaN(); + inputExtreme.PenetrationLength = (RoundedDouble) entity.LocationInputExtremePenetrationLength.ToNullAsNaN(); + } + + private static void SetGridparametersToInput(MacroStabilityInwardsGrid leftGrid, + MacroStabilityInwardsGrid rightGrid, + MacroStabilityInwardsCalculationEntity entity) + { + leftGrid.XLeft = (RoundedDouble) entity.LeftGridXLeft.ToNullAsNaN(); + leftGrid.XRight = (RoundedDouble) entity.LeftGridXRight.ToNullAsNaN(); + leftGrid.NumberOfHorizontalPoints = entity.LeftGridNrOfHorizontalPoints; + leftGrid.ZTop = (RoundedDouble) entity.LeftGridZTop.ToNullAsNaN(); + leftGrid.ZBottom = (RoundedDouble) entity.LeftGridZBottom.ToNullAsNaN(); + leftGrid.NumberOfVerticalPoints = entity.LeftGridNrOfVerticalPoints; + + rightGrid.XLeft = (RoundedDouble) entity.RightGridXLeft.ToNullAsNaN(); + rightGrid.XRight = (RoundedDouble) entity.RightGridXRight.ToNullAsNaN(); + rightGrid.NumberOfHorizontalPoints = entity.RightGridNrOfHorizontalPoints; + rightGrid.ZTop = (RoundedDouble) entity.RightGridZTop.ToNullAsNaN(); + rightGrid.ZBottom = (RoundedDouble) entity.RightGridZBottom.ToNullAsNaN(); + rightGrid.NumberOfVerticalPoints = entity.RightGridNrOfVerticalPoints; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsCalculationOutputEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsCalculationOutputEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsCalculationOutputEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,116 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using Core.Common.Base.Geometry; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Serializers; + +namespace Ringtoets.Storage.Core.Read.MacroStabilityInwards +{ + /// + /// This class defines extension methods for read operations for an + /// based on the . + /// + internal static class MacroStabilityInwardsCalculationOutputEntityReadExtensions + { + /// + /// Read the and use the information to + /// construct a . + /// + /// The to create + /// for. + /// A new . + /// Thrown when is null. + public static MacroStabilityInwardsOutput Read(this MacroStabilityInwardsCalculationOutputEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + MacroStabilityInwardsSlipPlaneUpliftVan slipPlane = ReadSlipPlane(entity); + MacroStabilityInwardsSlidingCurve slidingCurve = ReadSlidingCurve(entity); + + return new MacroStabilityInwardsOutput(slidingCurve, slipPlane, new MacroStabilityInwardsOutput.ConstructionProperties + { + FactorOfStability = entity.FactorOfStability.ToNullAsNaN(), + ForbiddenZonesXEntryMax = entity.ForbiddenZonesXEntryMax.ToNullAsNaN(), + ForbiddenZonesXEntryMin = entity.ForbiddenZonesXEntryMin.ToNullAsNaN(), + ZValue = entity.ZValue.ToNullAsNaN() + }); + } + + private static MacroStabilityInwardsSlipPlaneUpliftVan ReadSlipPlane(MacroStabilityInwardsCalculationOutputEntity entity) + { + var leftGrid = new MacroStabilityInwardsGrid(entity.SlipPlaneLeftGridXLeft.ToNullAsNaN(), + entity.SlipPlaneLeftGridXRight.ToNullAsNaN(), + entity.SlipPlaneLeftGridZTop.ToNullAsNaN(), + entity.SlipPlaneLeftGridZBottom.ToNullAsNaN()) + { + NumberOfHorizontalPoints = entity.SlipPlaneLeftGridNrOfHorizontalPoints, + NumberOfVerticalPoints = entity.SlipPlaneLeftGridNrOfVerticalPoints + }; + var rightGrid = new MacroStabilityInwardsGrid(entity.SlipPlaneRightGridXLeft.ToNullAsNaN(), + entity.SlipPlaneRightGridXRight.ToNullAsNaN(), + entity.SlipPlaneRightGridZTop.ToNullAsNaN(), + entity.SlipPlaneRightGridZBottom.ToNullAsNaN() + ) + { + NumberOfHorizontalPoints = entity.SlipPlaneRightGridNrOfHorizontalPoints, + NumberOfVerticalPoints = entity.SlipPlaneRightGridNrOfVerticalPoints + }; + + RoundedDouble[] tangentLines = new TangentLineCollectionXmlSerializer().FromXml(entity.SlipPlaneTangentLinesXml); + return new MacroStabilityInwardsSlipPlaneUpliftVan(leftGrid, rightGrid, tangentLines); + } + + private static MacroStabilityInwardsSlidingCurve ReadSlidingCurve(MacroStabilityInwardsCalculationOutputEntity entity) + { + var leftCircle = new MacroStabilityInwardsSlidingCircle(new Point2D(entity.SlidingCurveLeftSlidingCircleCenterX.ToNullAsNaN(), + entity.SlidingCurveLeftSlidingCircleCenterY.ToNullAsNaN()), + entity.SlidingCurveLeftSlidingCircleRadius.ToNullAsNaN(), + Convert.ToBoolean(entity.SlidingCurveLeftSlidingCircleIsActive), + entity.SlidingCurveLeftSlidingCircleNonIteratedForce.ToNullAsNaN(), + entity.SlidingCurveLeftSlidingCircleIteratedForce.ToNullAsNaN(), + entity.SlidingCurveLeftSlidingCircleDrivingMoment.ToNullAsNaN(), + entity.SlidingCurveLeftSlidingCircleResistingMoment.ToNullAsNaN()); + + var rightCircle = new MacroStabilityInwardsSlidingCircle(new Point2D(entity.SlidingCurveRightSlidingCircleCenterX.ToNullAsNaN(), + entity.SlidingCurveRightSlidingCircleCenterY.ToNullAsNaN()), + entity.SlidingCurveRightSlidingCircleRadius.ToNullAsNaN(), + Convert.ToBoolean(entity.SlidingCurveRightSlidingCircleIsActive), + entity.SlidingCurveRightSlidingCircleNonIteratedForce.ToNullAsNaN(), + entity.SlidingCurveRightSlidingCircleIteratedForce.ToNullAsNaN(), + entity.SlidingCurveRightSlidingCircleDrivingMoment.ToNullAsNaN(), + entity.SlidingCurveRightSlidingCircleResistingMoment.ToNullAsNaN()); + + MacroStabilityInwardsSlice[] slices = new MacroStabilityInwardsSliceCollectionXmlSerializer().FromXml(entity.SlidingCurveSliceXML); + return new MacroStabilityInwardsSlidingCurve(leftCircle, + rightCircle, + slices, + entity.SlidingCurveNonIteratedHorizontalForce.ToNullAsNaN(), + entity.SlidingCurveIteratedHorizontalForce.ToNullAsNaN()); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsFailureMechanismMetaEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsFailureMechanismMetaEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsFailureMechanismMetaEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,58 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.MacroStabilityInwards +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class MacroStabilityInwardsFailureMechanismMetaEntityReadExtensions + { + /// + /// Read the and use the information to + /// update the . + /// + /// The to use to + /// update the . + /// The to be updated. + /// Thrown when any input parameter is null. + internal static void ReadProbabilityAssessmentInput(this MacroStabilityInwardsFailureMechanismMetaEntity entity, + MacroStabilityInwardsProbabilityAssessmentInput probabilityAssessmentInput) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (probabilityAssessmentInput == null) + { + throw new ArgumentNullException(nameof(probabilityAssessmentInput)); + } + + probabilityAssessmentInput.A = entity.A; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsPreconsolidationStressEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsPreconsolidationStressEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsPreconsolidationStressEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using Core.Common.Base.Geometry; +using Ringtoets.Common.Data.Probabilistics; +using Ringtoets.MacroStabilityInwards.Data.SoilProfile; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.MacroStabilityInwards +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class MacroStabilityInwardsPreconsolidationStressEntityReadExtensions + { + /// + /// Reads the and use the information + /// to construct a . + /// + /// The to create + /// for. + /// A new . + /// Thrown when is null. + public static MacroStabilityInwardsPreconsolidationStress Read(this MacroStabilityInwardsPreconsolidationStressEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + var location = new Point2D(entity.CoordinateX, entity.CoordinateZ); + var distribution = new VariationCoefficientLogNormalDistribution + { + Mean = (RoundedDouble) entity.PreconsolidationStressMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.PreconsolidationStressCoefficientOfVariation.ToNullAsNaN() + }; + + return new MacroStabilityInwardsPreconsolidationStress(location, distribution); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsSectionResultEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsSectionResultEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsSectionResultEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,63 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Primitives; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.MacroStabilityInwards +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class MacroStabilityInwardsSectionResultEntityReadExtensions + { + /// + /// Reads the and use the information to update a + /// . + /// + /// The used to + /// update the . + /// The target of the read operation. + /// Thrown when any parameter is null. + internal static void Read(this MacroStabilityInwardsSectionResultEntity entity, MacroStabilityInwardsFailureMechanismSectionResult sectionResult) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (sectionResult == null) + { + throw new ArgumentNullException(nameof(sectionResult)); + } + + sectionResult.SimpleAssessmentResult = (SimpleAssessmentResultType) entity.SimpleAssessmentResult; + sectionResult.DetailedAssessmentResult = (DetailedAssessmentProbabilityOnlyResultType) entity.DetailedAssessmentResult; + sectionResult.TailorMadeAssessmentResult = (TailorMadeAssessmentProbabilityCalculationResultType) entity.TailorMadeAssessmentResult; + sectionResult.TailorMadeAssessmentProbability = entity.TailorMadeAssessmentProbability.ToNullAsNaN(); + sectionResult.UseManualAssembly = Convert.ToBoolean(entity.UseManualAssembly); + sectionResult.ManualAssemblyProbability = entity.ManualAssemblyProbability.ToNullAsNaN(); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsSoilLayerOneDEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsSoilLayerOneDEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsSoilLayerOneDEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,103 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using Ringtoets.MacroStabilityInwards.Data.SoilProfile; +using Ringtoets.MacroStabilityInwards.Primitives; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.MacroStabilityInwards +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class MacroStabilityInwardsSoilLayerOneDEntityReadExtensions + { + /// + /// Reads the and use the information + /// to construct a . + /// + /// The to create + /// for. + /// A new . + /// Thrown when is null. + public static MacroStabilityInwardsSoilLayer1D Read(this MacroStabilityInwardsSoilLayerOneDEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return new MacroStabilityInwardsSoilLayer1D(entity.Top.ToNullAsNaN(), ReadData(entity)); + } + + private static MacroStabilityInwardsSoilLayerData ReadData(MacroStabilityInwardsSoilLayerOneDEntity entity) + { + return new MacroStabilityInwardsSoilLayerData + { + IsAquifer = Convert.ToBoolean(entity.IsAquifer), + MaterialName = entity.MaterialName ?? string.Empty, + Color = entity.Color.ToColor(), + UsePop = Convert.ToBoolean(entity.UsePop), + ShearStrengthModel = (MacroStabilityInwardsShearStrengthModel) entity.ShearStrengthModel, + AbovePhreaticLevel = + { + Mean = (RoundedDouble) entity.AbovePhreaticLevelMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.AbovePhreaticLevelCoefficientOfVariation.ToNullAsNaN(), + Shift = (RoundedDouble) entity.AbovePhreaticLevelShift.ToNullAsNaN() + }, + BelowPhreaticLevel = + { + Mean = (RoundedDouble) entity.BelowPhreaticLevelMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.BelowPhreaticLevelCoefficientOfVariation.ToNullAsNaN(), + Shift = (RoundedDouble) entity.BelowPhreaticLevelShift.ToNullAsNaN() + }, + Cohesion = + { + Mean = (RoundedDouble) entity.CohesionMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.CohesionCoefficientOfVariation.ToNullAsNaN() + }, + FrictionAngle = + { + Mean = (RoundedDouble) entity.FrictionAngleMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.FrictionAngleCoefficientOfVariation.ToNullAsNaN() + }, + ShearStrengthRatio = + { + Mean = (RoundedDouble) entity.ShearStrengthRatioMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.ShearStrengthRatioCoefficientOfVariation.ToNullAsNaN() + }, + StrengthIncreaseExponent = + { + Mean = (RoundedDouble) entity.StrengthIncreaseExponentMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.StrengthIncreaseExponentCoefficientOfVariation.ToNullAsNaN() + }, + Pop = + { + Mean = (RoundedDouble) entity.PopMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.PopCoefficientOfVariation.ToNullAsNaN() + } + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsSoilLayerTwoDEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsSoilLayerTwoDEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsSoilLayerTwoDEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,117 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using Core.Common.Base.Data; +using Ringtoets.MacroStabilityInwards.Primitives; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Serializers; + +namespace Ringtoets.Storage.Core.Read.MacroStabilityInwards +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class MacroStabilityInwardsSoilLayerTwoDEntityReadExtensions + { + /// + /// Reads the and use the information + /// to construct a . + /// + /// The to create + /// for. + /// A new . + /// Thrown when is null. + public static MacroStabilityInwardsSoilLayer2D Read(this MacroStabilityInwardsSoilLayerTwoDEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + var outerRing = new Ring(new Point2DCollectionXmlSerializer().FromXml(entity.OuterRingXml)); + + return new MacroStabilityInwardsSoilLayer2D(outerRing, + ReadData(entity), + ReadNestedLayers(entity)); + } + + private static MacroStabilityInwardsSoilLayerData ReadData(MacroStabilityInwardsSoilLayerTwoDEntity entity) + { + return new MacroStabilityInwardsSoilLayerData + { + IsAquifer = Convert.ToBoolean(entity.IsAquifer), + MaterialName = entity.MaterialName ?? string.Empty, + Color = entity.Color.ToColor(), + UsePop = Convert.ToBoolean(entity.UsePop), + ShearStrengthModel = (MacroStabilityInwardsShearStrengthModel) entity.ShearStrengthModel, + AbovePhreaticLevel = + { + Mean = (RoundedDouble) entity.AbovePhreaticLevelMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.AbovePhreaticLevelCoefficientOfVariation.ToNullAsNaN(), + Shift = (RoundedDouble) entity.AbovePhreaticLevelShift.ToNullAsNaN() + }, + BelowPhreaticLevel = + { + Mean = (RoundedDouble) entity.BelowPhreaticLevelMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.BelowPhreaticLevelCoefficientOfVariation.ToNullAsNaN(), + Shift = (RoundedDouble) entity.BelowPhreaticLevelShift.ToNullAsNaN() + }, + Cohesion = + { + Mean = (RoundedDouble) entity.CohesionMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.CohesionCoefficientOfVariation.ToNullAsNaN() + }, + FrictionAngle = + { + Mean = (RoundedDouble) entity.FrictionAngleMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.FrictionAngleCoefficientOfVariation.ToNullAsNaN() + }, + ShearStrengthRatio = + { + Mean = (RoundedDouble) entity.ShearStrengthRatioMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.ShearStrengthRatioCoefficientOfVariation.ToNullAsNaN() + }, + StrengthIncreaseExponent = + { + Mean = (RoundedDouble) entity.StrengthIncreaseExponentMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.StrengthIncreaseExponentCoefficientOfVariation.ToNullAsNaN() + }, + Pop = + { + Mean = (RoundedDouble) entity.PopMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.PopCoefficientOfVariation.ToNullAsNaN() + } + }; + } + + private static IEnumerable ReadNestedLayers(MacroStabilityInwardsSoilLayerTwoDEntity entity) + { + return entity.MacroStabilityInwardsSoilLayerTwoDEntity1 + .OrderBy(e => e.Order) + .Select(e => e.Read()) + .ToArray(); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsSoilProfileOneDEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsSoilProfileOneDEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsSoilProfileOneDEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,75 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using Ringtoets.MacroStabilityInwards.Data.SoilProfile; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.MacroStabilityInwards +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class MacroStabilityInwardsSoilProfileOneDEntityReadExtensions + { + /// + /// Reads the and use the information + /// to construct a . + /// + /// The to + /// create for. + /// The object keeping track of read operations. + /// A new or one from the + /// if the has been read before. + /// Thrown when any input parameter is null. + public static MacroStabilityInwardsSoilProfile1D Read(this MacroStabilityInwardsSoilProfileOneDEntity entity, + ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (collector.Contains(entity)) + { + return collector.Get(entity); + } + + IEnumerable layers = entity.MacroStabilityInwardsSoilLayerOneDEntities.OrderBy(sl => sl.Order) + .Select(sl => sl.Read()) + .ToArray(); + var macroStabilityInwardsSoilProfile = new MacroStabilityInwardsSoilProfile1D(entity.Name, + entity.Bottom.ToNullAsNaN(), + layers); + + collector.Read(entity, macroStabilityInwardsSoilProfile); + return macroStabilityInwardsSoilProfile; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsSoilProfileTwoDEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsSoilProfileTwoDEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsSoilProfileTwoDEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,81 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using Ringtoets.MacroStabilityInwards.Data.SoilProfile; +using Ringtoets.MacroStabilityInwards.Primitives; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.MacroStabilityInwards +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class MacroStabilityInwardsSoilProfileTwoDEntityReadExtensions + { + /// + /// Reads the and use the information + /// to construct a . + /// + /// The to + /// create for. + /// The object keeping track of read operations. + /// A new or one from the + /// if the has been read before. + /// Thrown when any input parameter is null. + public static MacroStabilityInwardsSoilProfile2D Read(this MacroStabilityInwardsSoilProfileTwoDEntity entity, + ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (collector.Contains(entity)) + { + return collector.Get(entity); + } + + IEnumerable layers = entity.MacroStabilityInwardsSoilLayerTwoDEntities + .OrderBy(sl => sl.Order) + .Select(sl => sl.Read()) + .ToArray(); + IEnumerable preconsolidationStresses = entity.MacroStabilityInwardsPreconsolidationStressEntities + .OrderBy(stressEntity => stressEntity.Order) + .Select(stressEntity => stressEntity.Read()) + .ToArray(); + var soilProfile = new MacroStabilityInwardsSoilProfile2D(entity.Name, + layers, + preconsolidationStresses); + + collector.Read(entity, soilProfile); + return soilProfile; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,89 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.MacroStabilityInwards.Data.SoilProfile; +using Ringtoets.MacroStabilityInwards.Primitives; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.MacroStabilityInwards +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class MacroStabilityInwardsStochasticSoilProfileEntityReadExtensions + { + /// + /// Reads the and use the information to + /// construct a . + /// + /// The to create + /// for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when any input parameter is null. + public static MacroStabilityInwardsStochasticSoilProfile Read(this MacroStabilityInwardsStochasticSoilProfileEntity entity, + ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (collector.Contains(entity)) + { + return collector.Get(entity); + } + + var stochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(entity.Probability, entity.ReadSoilProfile(collector)); + + collector.Read(entity, stochasticSoilProfile); + + return stochasticSoilProfile; + } + + private static IMacroStabilityInwardsSoilProfile ReadSoilProfile(this MacroStabilityInwardsStochasticSoilProfileEntity entity, + ReadConversionCollector collector) + { + return entity.MacroStabilityInwardsSoilProfileOneDEntity != null + ? (IMacroStabilityInwardsSoilProfile) ReadSoilProfile1D(entity, collector) + : ReadSoilProfile2D(entity, collector); + } + + private static IMacroStabilityInwardsSoilProfile ReadSoilProfile1D(this MacroStabilityInwardsStochasticSoilProfileEntity entity, + ReadConversionCollector collector) + { + return entity.MacroStabilityInwardsSoilProfileOneDEntity.Read(collector); + } + + private static IMacroStabilityInwardsSoilProfile ReadSoilProfile2D(this MacroStabilityInwardsStochasticSoilProfileEntity entity, + ReadConversionCollector collector) + { + return entity.MacroStabilityInwardsSoilProfileTwoDEntity.Read(collector); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityOutwards/MacroStabilityOutwardsFailureMechanismMetaEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityOutwards/MacroStabilityOutwardsFailureMechanismMetaEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityOutwards/MacroStabilityOutwardsFailureMechanismMetaEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,58 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Integration.Data.StandAlone.Input; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.MacroStabilityOutwards +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class MacroStabilityOutwardsFailureMechanismMetaEntityReadExtensions + { + /// + /// Read the and use the information to + /// update the . + /// + /// The to use to + /// update the . + /// The to be updated. + /// Thrown when any input parameter is null. + internal static void ReadProbabilityAssessmentInput(this MacroStabilityOutwardsFailureMechanismMetaEntity entity, + MacroStabilityOutwardsProbabilityAssessmentInput probabilityAssessmentInput) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (probabilityAssessmentInput == null) + { + throw new ArgumentNullException(nameof(probabilityAssessmentInput)); + } + + probabilityAssessmentInput.A = entity.A; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityOutwards/MacroStabilityOutwardsSectionResultEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityOutwards/MacroStabilityOutwardsSectionResultEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MacroStabilityOutwards/MacroStabilityOutwardsSectionResultEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,63 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Primitives; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.MacroStabilityOutwards +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class MacroStabilityOutwardsSectionResultEntityReadExtensions + { + /// + /// Reads the and use the information to update a + /// . + /// + /// The used to update . + /// The target of the read operation. + /// Thrown when any parameter is null. + internal static void Read(this MacroStabilityOutwardsSectionResultEntity entity, MacroStabilityOutwardsFailureMechanismSectionResult sectionResult) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (sectionResult == null) + { + throw new ArgumentNullException(nameof(sectionResult)); + } + + sectionResult.SimpleAssessmentResult = (SimpleAssessmentResultType) entity.SimpleAssessmentResult; + sectionResult.DetailedAssessmentResult = (DetailedAssessmentProbabilityOnlyResultType) entity.DetailedAssessmentResult; + sectionResult.DetailedAssessmentProbability = entity.DetailedAssessmentProbability.ToNullAsNaN(); + sectionResult.TailorMadeAssessmentResult = (TailorMadeAssessmentProbabilityAndDetailedCalculationResultType) entity.TailorMadeAssessmentResult; + sectionResult.TailorMadeAssessmentProbability = entity.TailorMadeAssessmentProbability.ToNullAsNaN(); + sectionResult.UseManualAssembly = Convert.ToBoolean(entity.UseManualAssembly); + sectionResult.ManualAssemblyCategoryGroup = (ManualFailureMechanismSectionAssemblyCategoryGroup) entity.ManualAssemblyCategoryGroup; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MicrostabilitySectionResultEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MicrostabilitySectionResultEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/MicrostabilitySectionResultEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,61 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Primitives; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class MicrostabilitySectionResultEntityReadExtensions + { + /// + /// Reads the and use the information to update a + /// . + /// + /// The used to update . + /// The target of the read operation. + /// Thrown when any parameter is null. + internal static void Read(this MicrostabilitySectionResultEntity entity, MicrostabilityFailureMechanismSectionResult sectionResult) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (sectionResult == null) + { + throw new ArgumentNullException(nameof(sectionResult)); + } + + sectionResult.SimpleAssessmentResult = (SimpleAssessmentResultType) entity.SimpleAssessmentResult; + sectionResult.DetailedAssessmentResult = (DetailedAssessmentResultType) entity.DetailedAssessmentResult; + sectionResult.TailorMadeAssessmentResult = (TailorMadeAssessmentResultType) entity.TailorMadeAssessmentResult; + sectionResult.UseManualAssembly = Convert.ToBoolean(entity.UseManualAssembly); + sectionResult.ManualAssemblyCategoryGroup = (ManualFailureMechanismSectionAssemblyCategoryGroup) entity.ManualAssemblyCategoryGroup; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingCalculationEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingCalculationEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingCalculationEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,109 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Linq; +using Core.Common.Base.Data; +using Ringtoets.Piping.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.Piping +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class PipingCalculationEntityReadExtensions + { + /// + /// Read the and use the information to + /// construct a . + /// + /// The to create + /// for. + /// The object keeping track of read operations. + /// The general input parameters that apply + /// to all instances. + /// A new . + /// Thrown when is null. + public static PipingCalculationScenario Read(this PipingCalculationEntity entity, ReadConversionCollector collector, + GeneralPipingInput generalInputParameters) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + var calculation = new PipingCalculationScenario(generalInputParameters) + { + IsRelevant = Convert.ToBoolean(entity.RelevantForScenario), + Contribution = (RoundedDouble) entity.ScenarioContribution.ToNullAsNaN(), + Name = entity.Name, + Comments = + { + Body = entity.Comments + } + }; + ReadInputParameters(calculation.InputParameters, entity, collector); + ReadCalculationOutputs(calculation, entity); + + return calculation; + } + + private static void ReadCalculationOutputs(PipingCalculationScenario calculation, PipingCalculationEntity entity) + { + PipingCalculationOutputEntity calculationOutputEntity = entity.PipingCalculationOutputEntities.FirstOrDefault(); + if (calculationOutputEntity != null) + { + calculation.Output = calculationOutputEntity.Read(); + } + } + + private static void ReadInputParameters(PipingInput inputParameters, PipingCalculationEntity entity, ReadConversionCollector collector) + { + if (entity.SurfaceLineEntity != null) + { + inputParameters.SurfaceLine = entity.SurfaceLineEntity.ReadAsPipingSurfaceLine(collector); + } + + inputParameters.UseAssessmentLevelManualInput = Convert.ToBoolean(entity.UseAssessmentLevelManualInput); + inputParameters.AssessmentLevel = (RoundedDouble) entity.AssessmentLevel.ToNullAsNaN(); + + if (entity.HydraulicLocationEntity != null) + { + inputParameters.HydraulicBoundaryLocation = entity.HydraulicLocationEntity.Read(collector); + } + + if (entity.PipingStochasticSoilProfileEntity != null) + { + inputParameters.StochasticSoilModel = entity.PipingStochasticSoilProfileEntity.StochasticSoilModelEntity.ReadAsPipingStochasticSoilModel(collector); + inputParameters.StochasticSoilProfile = entity.PipingStochasticSoilProfileEntity.Read(collector); + } + + inputParameters.EntryPointL = (RoundedDouble) entity.EntryPointL.ToNullAsNaN(); + inputParameters.ExitPointL = (RoundedDouble) entity.ExitPointL.ToNullAsNaN(); + inputParameters.PhreaticLevelExit.Mean = (RoundedDouble) entity.PhreaticLevelExitMean.ToNullAsNaN(); + inputParameters.PhreaticLevelExit.StandardDeviation = (RoundedDouble) entity.PhreaticLevelExitStandardDeviation.ToNullAsNaN(); + inputParameters.DampingFactorExit.Mean = (RoundedDouble) entity.DampingFactorExitMean.ToNullAsNaN(); + inputParameters.DampingFactorExit.StandardDeviation = (RoundedDouble) entity.DampingFactorExitStandardDeviation.ToNullAsNaN(); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingCalculationOutputEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingCalculationOutputEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingCalculationOutputEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,66 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Piping.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.Piping +{ + /// + /// This class defines extension methods for read operations for an + /// based on the . + /// + internal static class PipingCalculationOutputEntityReadExtensions + { + /// + /// Read the and use the information to + /// construct a . + /// + /// The to create + /// for. + /// A new . + /// Thrown when + /// is null. + public static PipingOutput Read(this PipingCalculationOutputEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return new PipingOutput(new PipingOutput.ConstructionProperties + { + UpliftZValue = entity.UpliftZValue.ToNullAsNaN(), + UpliftFactorOfSafety = entity.UpliftFactorOfSafety.ToNullAsNaN(), + HeaveZValue = entity.HeaveZValue.ToNullAsNaN(), + HeaveFactorOfSafety = entity.HeaveFactorOfSafety.ToNullAsNaN(), + SellmeijerZValue = entity.SellmeijerZValue.ToNullAsNaN(), + SellmeijerFactorOfSafety = entity.SellmeijerFactorOfSafety.ToNullAsNaN(), + UpliftEffectiveStress = entity.UpliftEffectiveStress.ToNullAsNaN(), + HeaveGradient = entity.HeaveGradient.ToNullAsNaN(), + SellmeijerCreepCoefficient = entity.SellmeijerCreepCoefficient.ToNullAsNaN(), + SellmeijerCriticalFall = entity.SellmeijerCriticalFall.ToNullAsNaN(), + SellmeijerReducedFall = entity.SellmeijerReducedFall.ToNullAsNaN() + }); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingFailureMechanismMetaEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingFailureMechanismMetaEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingFailureMechanismMetaEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,84 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using Ringtoets.Piping.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.Piping +{ + /// + /// This class defines extension methods for read operations for a + /// and a based on the . + /// + internal static class PipingFailureMechanismMetaEntityReadExtensions + { + /// + /// Read the and use the information to update the + /// . + /// + /// The to use to update the + /// . + /// The to be + /// updated. + /// Thrown when any input parameter is null. + internal static void ReadProbabilityAssessmentInput(this PipingFailureMechanismMetaEntity entity, + PipingProbabilityAssessmentInput probabilityAssessmentInput) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (probabilityAssessmentInput == null) + { + throw new ArgumentNullException(nameof(probabilityAssessmentInput)); + } + + probabilityAssessmentInput.A = entity.A; + } + + /// + /// Read the and use the information to update the + /// . + /// + /// The to use to update the + /// . + /// The to be updated. + /// Thrown when any input parameter is null. + internal static void ReadGeneralPipingInput(this PipingFailureMechanismMetaEntity entity, + GeneralPipingInput generalPipingInput) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (generalPipingInput == null) + { + throw new ArgumentNullException(nameof(generalPipingInput)); + } + + generalPipingInput.WaterVolumetricWeight = (RoundedDouble) entity.WaterVolumetricWeight; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingSectionResultEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingSectionResultEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingSectionResultEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,63 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Primitives; +using Ringtoets.Piping.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.Piping +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class PipingSectionResultEntityReadExtensions + { + /// + /// Reads the and use the information to construct a + /// . + /// + /// The used to update + /// the . + /// The target of the read operation. + /// Thrown when any parameter is null. + internal static void Read(this PipingSectionResultEntity entity, PipingFailureMechanismSectionResult sectionResult) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (sectionResult == null) + { + throw new ArgumentNullException(nameof(sectionResult)); + } + + sectionResult.SimpleAssessmentResult = (SimpleAssessmentResultType) entity.SimpleAssessmentResult; + sectionResult.DetailedAssessmentResult = (DetailedAssessmentProbabilityOnlyResultType) entity.DetailedAssessmentResult; + sectionResult.TailorMadeAssessmentResult = (TailorMadeAssessmentProbabilityCalculationResultType) entity.TailorMadeAssessmentResult; + sectionResult.TailorMadeAssessmentProbability = entity.TailorMadeAssessmentProbability.ToNullAsNaN(); + sectionResult.UseManualAssembly = Convert.ToBoolean(entity.UseManualAssembly); + sectionResult.ManualAssemblyProbability = entity.ManualAssemblyProbability.ToNullAsNaN(); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingSoilLayerEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingSoilLayerEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingSoilLayerEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,73 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using Ringtoets.Common.Data.Probabilistics; +using Ringtoets.Piping.Primitives; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.Piping +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class PipingSoilLayerEntityReadExtensions + { + /// + /// Reads the and use the information to construct a . + /// + /// The to create for. + /// A new . + /// Thrown when is null. + public static PipingSoilLayer Read(this PipingSoilLayerEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return new PipingSoilLayer(entity.Top.ToNullAsNaN()) + { + IsAquifer = Convert.ToBoolean(entity.IsAquifer), + Color = entity.Color.ToColor(), + MaterialName = entity.MaterialName ?? string.Empty, + BelowPhreaticLevel = new LogNormalDistribution + { + Mean = (RoundedDouble) entity.BelowPhreaticLevelMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.BelowPhreaticLevelDeviation.ToNullAsNaN(), + Shift = (RoundedDouble) entity.BelowPhreaticLevelShift.ToNullAsNaN() + }, + DiameterD70 = new VariationCoefficientLogNormalDistribution + { + Mean = (RoundedDouble) entity.DiameterD70Mean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.DiameterD70CoefficientOfVariation.ToNullAsNaN() + }, + Permeability = new VariationCoefficientLogNormalDistribution + { + Mean = (RoundedDouble) entity.PermeabilityMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.PermeabilityCoefficientOfVariation.ToNullAsNaN() + } + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingSoilProfileEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingSoilProfileEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingSoilProfileEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,73 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using Ringtoets.Piping.Primitives; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.Piping +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class PipingSoilProfileEntityReadExtensions + { + /// + /// Reads the and use the information to construct a . + /// + /// The to create for. + /// The object keeping track of read operations. + /// A new or one from the if the + /// has been read before. + /// Thrown when any input parameter is null. + public static PipingSoilProfile Read(this PipingSoilProfileEntity entity, ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (collector.Contains(entity)) + { + return collector.Get(entity); + } + + IEnumerable layers = entity.PipingSoilLayerEntities.OrderBy(sl => sl.Order) + .Select(sl => sl.Read()) + .ToArray(); + var pipingSoilProfile = new PipingSoilProfile(entity.Name, + entity.Bottom.ToNullAsNaN(), + layers, + (SoilProfileType) entity.SourceType); + + collector.Read(entity, pipingSoilProfile); + return pipingSoilProfile; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingStochasticSoilProfileEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingStochasticSoilProfileEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/Piping/PipingStochasticSoilProfileEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,76 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Piping.Data.SoilProfile; +using Ringtoets.Piping.Primitives; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.Piping +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class PipingStochasticSoilProfileEntityReadExtensions + { + /// + /// Reads the and use the information to + /// construct a . + /// + /// The to create + /// for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when any input parameter is null. + internal static PipingStochasticSoilProfile Read(this PipingStochasticSoilProfileEntity entity, + ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (collector.Contains(entity)) + { + return collector.Get(entity); + } + + PipingSoilProfile soilProfile = entity.ReadSoilProfile(collector); + var stochasticSoilProfile = new PipingStochasticSoilProfile(entity.Probability, soilProfile); + + collector.Read(entity, stochasticSoilProfile); + + return stochasticSoilProfile; + } + + private static PipingSoilProfile ReadSoilProfile(this PipingStochasticSoilProfileEntity entity, + ReadConversionCollector collector) + { + return entity.PipingSoilProfileEntity.Read(collector); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/PipingStructure/PipingStructureSectionResultEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/PipingStructure/PipingStructureSectionResultEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/PipingStructure/PipingStructureSectionResultEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Primitives; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.PipingStructure +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class PipingStructureSectionResultEntityReadExtensions + { + /// + /// Read the and use the information to update a + /// . + /// + /// The used to update . + /// The to be updated. + /// Thrown when any parameter is null. + internal static void Read(this PipingStructureSectionResultEntity entity, + PipingStructureFailureMechanismSectionResult sectionResult) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (sectionResult == null) + { + throw new ArgumentNullException(nameof(sectionResult)); + } + + sectionResult.SimpleAssessmentResult = (SimpleAssessmentResultType) entity.SimpleAssessmentResult; + sectionResult.DetailedAssessmentResult = (DetailedAssessmentResultType) entity.DetailedAssessmentResult; + sectionResult.TailorMadeAssessmentResult = (TailorMadeAssessmentResultType) entity.TailorMadeAssessmentResult; + sectionResult.UseManualAssembly = Convert.ToBoolean(entity.UseManualAssembly); + sectionResult.ManualAssemblyCategoryGroup = (ManualFailureMechanismSectionAssemblyCategoryGroup) entity.ManualAssemblyCategoryGroup; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ProjectEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ProjectEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ProjectEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Linq; +using Ringtoets.Integration.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// This class defines extension methods for read operations for an based on the + /// . + /// + internal static class ProjectEntityReadExtensions + { + /// + /// Reads the and use the information to construct a . + /// + /// The to create for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + internal static RingtoetsProject Read(this ProjectEntity entity, ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + var project = new RingtoetsProject + { + Description = entity.Description + }; + + foreach (AssessmentSectionEntity assessmentSectionEntity in entity.AssessmentSectionEntities.OrderBy(ase => ase.Order)) + { + project.AssessmentSections.Add(assessmentSectionEntity.Read(collector)); + } + + return project; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ReadConversionCollector.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ReadConversionCollector.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/ReadConversionCollector.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,1609 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Util; +using Ringtoets.ClosingStructures.Data; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Data.Structures; +using Ringtoets.DuneErosion.Data; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.HeightStructures.Data; +using Ringtoets.MacroStabilityInwards.Data.SoilProfile; +using Ringtoets.MacroStabilityInwards.Primitives; +using Ringtoets.Piping.Data.SoilProfile; +using Ringtoets.Piping.Primitives; +using Ringtoets.StabilityPointStructures.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// Class that can be used to keep track of data model objects which were initialized during a read operation + /// from the database. Can be used to reuse objects when reading an already read entity. + /// + internal class ReadConversionCollector + { + private readonly Dictionary pipingStochasticSoilModels = + CreateDictionary(); + + private readonly Dictionary pipingStochasticSoilProfiles = + CreateDictionary(); + + private readonly Dictionary pipingSoilProfiles = + CreateDictionary(); + + private readonly Dictionary pipingSurfaceLines = + CreateDictionary(); + + private readonly Dictionary macroStabilityInwardsStochasticSoilModels = + CreateDictionary(); + + private readonly Dictionary macroStabilityInwardsStochasticSoilProfiles = + CreateDictionary(); + + private readonly Dictionary macroStabilityInwardsSoil1DProfiles = + CreateDictionary(); + + private readonly Dictionary macroStabilityInwardsSoil2DProfiles = + CreateDictionary(); + + private readonly Dictionary macroStabilityInwardsSurfaceLines = + CreateDictionary(); + + private readonly Dictionary hydraulicBoundaryLocations = + CreateDictionary(); + + private readonly Dictionary duneLocations = + CreateDictionary(); + + private readonly Dictionary failureMechanismSections = + CreateDictionary(); + + private readonly Dictionary dikeProfiles = + CreateDictionary(); + + private readonly Dictionary foreshoreProfiles = + CreateDictionary(); + + private readonly Dictionary grassCoverErosionInwardsCalculations = + CreateDictionary(); + + private readonly Dictionary heightStructures = + CreateDictionary(); + + private readonly Dictionary closingStructures = + CreateDictionary(); + + private readonly Dictionary stabilityPointStructures = + CreateDictionary(); + + private readonly Dictionary> heightStructuresCalculations = + CreateDictionary>(); + + private readonly Dictionary> closingStructuresCalculations = + CreateDictionary>(); + + private readonly Dictionary> stabilityPointStructuresCalculations = + CreateDictionary>(); + + private static Dictionary CreateDictionary() + { + return new Dictionary(new ReferenceEqualityComparer()); + } + + #region StochasticSoilModelEntity: Read, Contains, Get + + /// + /// Registers a read operation for and the + /// that was constructed with the information. + /// + /// The that was read. + /// The that was constructed. + /// Thrown when any of the input parameters is null. + internal void Read(StochasticSoilModelEntity entity, PipingStochasticSoilModel model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + pipingStochasticSoilModels[entity] = model; + } + + /// + /// Checks whether a read operations has been registered for the given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool ContainsPipingStochasticSoilModel(StochasticSoilModelEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return pipingStochasticSoilModels.ContainsKey(entity); + } + + /// + /// Obtains the which was read for the given . + /// + /// The for which a + /// read operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has been registered for + /// . + /// Use to find out + /// whether a read operation has been registered for . + internal PipingStochasticSoilModel GetPipingStochasticSoilModel(StochasticSoilModelEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return pipingStochasticSoilModels[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + /// + /// Registers a read operation for and the + /// that was constructed with the information. + /// + /// The that was read. + /// The that was constructed. + /// Thrown when any of the input parameters is null. + internal void Read(StochasticSoilModelEntity entity, MacroStabilityInwardsStochasticSoilModel model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + macroStabilityInwardsStochasticSoilModels[entity] = model; + } + + /// + /// Checks whether a read operations has been registered for the given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool ContainsMacroStabilityInwardsStochasticSoilModel(StochasticSoilModelEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return macroStabilityInwardsStochasticSoilModels.ContainsKey(entity); + } + + /// + /// Obtains the which was read + /// for the given . + /// + /// The for which a read + /// operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has been registered for + /// . + /// Use to find out + /// whether a read operation has been registered for . + internal MacroStabilityInwardsStochasticSoilModel GetMacroStabilityInwardsStochasticSoilModel(StochasticSoilModelEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return macroStabilityInwardsStochasticSoilModels[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + + #region PipingStochasticSoilProfileEntity: Read, Contains, Get + + /// + /// Registers a read operation for and + /// the that was constructed with the information. + /// + /// The that was read. + /// The that was constructed. + /// Thrown when any of the input parameters is null. + internal void Read(PipingStochasticSoilProfileEntity entity, PipingStochasticSoilProfile model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + pipingStochasticSoilProfiles[entity] = model; + } + + /// + /// Checks whether a read operations has been registered for the given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool Contains(PipingStochasticSoilProfileEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return pipingStochasticSoilProfiles.ContainsKey(entity); + } + + /// + /// Obtains the which was read for the given + /// . + /// + /// The for which + /// a read operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has been + /// registered for . + /// Use to find out + /// whether a read operation has been registered for . + internal PipingStochasticSoilProfile Get(PipingStochasticSoilProfileEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return pipingStochasticSoilProfiles[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + + #region PipingSoilProfileEntity: Read, Contains, Get + + /// + /// Registers a read operation for and the + /// that was constructed with the information. + /// + /// The that was read. + /// The that was constructed. + /// Thrown when any of the input parameters is null. + internal void Read(PipingSoilProfileEntity entity, PipingSoilProfile model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + pipingSoilProfiles[entity] = model; + } + + /// + /// Checks whether a read operations has been registered for the given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool Contains(PipingSoilProfileEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return pipingSoilProfiles.ContainsKey(entity); + } + + /// + /// Obtains the which was read for the given . + /// + /// The for which a read operation + /// has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has been + /// registered for . + /// Use to find out whether a + /// read operation has been registered for . + internal PipingSoilProfile Get(PipingSoilProfileEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return pipingSoilProfiles[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + + #region SurfaceLineEntity: Read, Contains, Get + + /// + /// Registers a read operation for and the + /// that was constructed with the information. + /// + /// The that was read. + /// The that was constructed. + /// Thrown when any of the input parameters is null. + internal void Read(SurfaceLineEntity entity, PipingSurfaceLine model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + pipingSurfaceLines[entity] = model; + } + + /// + /// Checks whether a read operation has been registered for a given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool ContainsPipingSurfaceLine(SurfaceLineEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return pipingSurfaceLines.ContainsKey(entity); + } + + /// + /// Obtains the which was read for the + /// given . + /// + /// The for which a read operation + /// has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has + /// been registered for . + /// Use to find out whether a + /// read operation has been registered for . + internal PipingSurfaceLine GetPipingSurfaceLine(SurfaceLineEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return pipingSurfaceLines[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + /// + /// Registers a read operation for and the + /// that was constructed with the information. + /// + /// The that was read. + /// The that was constructed. + /// Thrown when any of the input parameters is null. + internal void Read(SurfaceLineEntity entity, MacroStabilityInwardsSurfaceLine model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + macroStabilityInwardsSurfaceLines[entity] = model; + } + + /// + /// Checks whether a read operation has been registered for a given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool ContainsMacroStabilityInwardsSurfaceLine(SurfaceLineEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return macroStabilityInwardsSurfaceLines.ContainsKey(entity); + } + + /// + /// Obtains the which was read for the + /// given . + /// + /// The for which a read operation + /// has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has + /// been registered for . + /// Use to find out whether a + /// read operation has been registered for . + internal MacroStabilityInwardsSurfaceLine GetMacroStabilityInwardsSurfaceLine(SurfaceLineEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return macroStabilityInwardsSurfaceLines[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + + #region MacroStabilityInwardsStochasticSoilProfileEntity: Read, Contains, Get + + /// + /// Registers a read operation for and + /// the that was constructed with the information. + /// + /// The that was read. + /// The that was constructed. + /// Thrown when any of the input parameters is null. + internal void Read(MacroStabilityInwardsStochasticSoilProfileEntity entity, MacroStabilityInwardsStochasticSoilProfile model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + macroStabilityInwardsStochasticSoilProfiles[entity] = model; + } + + /// + /// Checks whether a read operations has been registered for the given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool Contains(MacroStabilityInwardsStochasticSoilProfileEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return macroStabilityInwardsStochasticSoilProfiles.ContainsKey(entity); + } + + /// + /// Obtains the which was read for the given + /// . + /// + /// The for which + /// a read operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has been + /// registered for . + /// Use to find out + /// whether a read operation has been registered for . + internal MacroStabilityInwardsStochasticSoilProfile Get(MacroStabilityInwardsStochasticSoilProfileEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return macroStabilityInwardsStochasticSoilProfiles[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + + #region MacroStabilityInwardsSoilProfileOneDEntity: Read, Contains, Get + + /// + /// Registers a read operation for and the + /// that was constructed with the information. + /// + /// The that was read. + /// The that was constructed. + /// Thrown when any of the input parameters is null. + internal void Read(MacroStabilityInwardsSoilProfileOneDEntity entity, MacroStabilityInwardsSoilProfile1D model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + macroStabilityInwardsSoil1DProfiles[entity] = model; + } + + /// + /// Checks whether a read operation has been registered for a given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool Contains(MacroStabilityInwardsSoilProfileOneDEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return macroStabilityInwardsSoil1DProfiles.ContainsKey(entity); + } + + /// + /// Obtains the which was read for the + /// given . + /// + /// The for which a read operation + /// has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has + /// been registered for . + /// Use to find out whether a + /// read operation has been registered for . + internal MacroStabilityInwardsSoilProfile1D Get(MacroStabilityInwardsSoilProfileOneDEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return macroStabilityInwardsSoil1DProfiles[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + + #region MacroStabilityInwardsSoilProfileTwoDEntity: Read, Contains, Get + + /// + /// Registers a read operation for and the + /// that was constructed with the information. + /// + /// The that was read. + /// The that was constructed. + /// Thrown when any of the input parameters is null. + internal void Read(MacroStabilityInwardsSoilProfileTwoDEntity entity, MacroStabilityInwardsSoilProfile2D model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + macroStabilityInwardsSoil2DProfiles[entity] = model; + } + + /// + /// Checks whether a read operation has been registered for a given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool Contains(MacroStabilityInwardsSoilProfileTwoDEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return macroStabilityInwardsSoil2DProfiles.ContainsKey(entity); + } + + /// + /// Obtains the which was read for the + /// given . + /// + /// The for which a read operation + /// has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has + /// been registered for . + /// Use to find out whether a + /// read operation has been registered for . + internal MacroStabilityInwardsSoilProfile2D Get(MacroStabilityInwardsSoilProfileTwoDEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return macroStabilityInwardsSoil2DProfiles[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + + #region HydraulicLocationEntity: Read, Contains, Get + + /// + /// Registers a read operation for and the + /// that was constructed with the information. + /// + /// The that was read. + /// The that was constructed. + /// Thrown when any of the input parameters is null. + internal void Read(HydraulicLocationEntity entity, HydraulicBoundaryLocation model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + hydraulicBoundaryLocations[entity] = model; + } + + /// + /// Checks whether a read operation has been registered for a given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool Contains(HydraulicLocationEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return hydraulicBoundaryLocations.ContainsKey(entity); + } + + /// + /// Obtains the which was read for the + /// given . + /// + /// The for which a read + /// operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has + /// been registered for . + /// Use to find out whether a + /// read operation has been registered for . + internal HydraulicBoundaryLocation Get(HydraulicLocationEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return hydraulicBoundaryLocations[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + + #region DuneLocationEntity: Read, Contains, Get + + /// + /// Registers a read operation for and the + /// that was constructed with the information. + /// + /// The that was read. + /// The that was constructed. + /// Thrown when any of the input parameters is null. + internal void Read(DuneLocationEntity entity, DuneLocation model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + duneLocations[entity] = model; + } + + /// + /// Checks whether a read operation has been registered for a given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool Contains(DuneLocationEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return duneLocations.ContainsKey(entity); + } + + /// + /// Obtains the which was read for the + /// given . + /// + /// The for which a read + /// operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has + /// been registered for . + /// Use to find out whether a + /// read operation has been registered for . + internal DuneLocation Get(DuneLocationEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return duneLocations[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + + #region FailureMechanismSectionEntity: Read, Contains, Get + + /// + /// Registers a read operation for and the + /// that was constructed with the information. + /// + /// The that was read. + /// The that was constructed. + /// Thrown when any of the input parameters is null. + internal void Read(FailureMechanismSectionEntity entity, FailureMechanismSection model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + failureMechanismSections[entity] = model; + } + + /// + /// Checks whether a read operation has been registered for a given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool Contains(FailureMechanismSectionEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return failureMechanismSections.ContainsKey(entity); + } + + /// + /// Obtains the which was read for the + /// given . + /// + /// The for which a read + /// operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has + /// been registered for . + /// Use to find out whether a + /// read operation has been registered for . + internal FailureMechanismSection Get(FailureMechanismSectionEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return failureMechanismSections[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + + #region DikeProfileEntity: Read, Contains, Get + + /// + /// Registers a read operation for and the + /// that was constructed with the information. + /// + /// The that was read. + /// The that was constructed. + /// Thrown when any of the input parameters is null. + internal void Read(DikeProfileEntity entity, DikeProfile model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + dikeProfiles[entity] = model; + } + + /// + /// Checks whether a read operation has been registered for a given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool Contains(DikeProfileEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return dikeProfiles.ContainsKey(entity); + } + + /// + /// Obtains the which was read for the + /// given . + /// + /// The for which a read + /// operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has + /// been registered for . + /// Use to find out whether a + /// read operation has been registered for . + internal DikeProfile Get(DikeProfileEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return dikeProfiles[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + + #region ForeshoreProfileEntity: Read, Contains, Get + + /// + /// Registers a read operation for and the + /// that was constructed with the information. + /// + /// The that was read. + /// The that was constructed. + /// Thrown when any of the input parameters is null. + internal void Read(ForeshoreProfileEntity entity, ForeshoreProfile model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + foreshoreProfiles[entity] = model; + } + + /// + /// Checks whether a read operation has been registered for a given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool Contains(ForeshoreProfileEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return foreshoreProfiles.ContainsKey(entity); + } + + /// + /// Obtains the which was read for the + /// given . + /// + /// The for which a read + /// operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has + /// been registered for . + /// Use to find out whether a + /// read operation has been registered for . + internal ForeshoreProfile Get(ForeshoreProfileEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return foreshoreProfiles[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + + #region GrassCoverErosionInwardsCalculationEntity: Read, Contains, Get + + /// + /// Registers a read operation for + /// and the that was constructed + /// with the information. + /// + /// The + /// that was read. + /// The that + /// was constructed. + /// Thrown when any of the input parameters is null. + internal void Read(GrassCoverErosionInwardsCalculationEntity entity, GrassCoverErosionInwardsCalculation model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + grassCoverErosionInwardsCalculations[entity] = model; + } + + /// + /// Checks whether a read operation has been registered for a given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool Contains(GrassCoverErosionInwardsCalculationEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return grassCoverErosionInwardsCalculations.ContainsKey(entity); + } + + /// + /// Obtains the which was read + /// for the given . + /// + /// The for which a read + /// operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has + /// been registered for . + /// Use + /// to find out whether a read operation has been registered for . + internal GrassCoverErosionInwardsCalculation Get(GrassCoverErosionInwardsCalculationEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return grassCoverErosionInwardsCalculations[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + + #region HeightStructureEntity: Read, Contains, Get + + /// + /// Registers a read operation for and the + /// that was constructed with the information. + /// + /// The that was read. + /// The that was constructed. + /// Thrown when any of the input parameters is null. + internal void Read(HeightStructureEntity entity, HeightStructure model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + heightStructures[entity] = model; + } + + /// + /// Checks whether a read operation has been registered for a given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool Contains(HeightStructureEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return heightStructures.ContainsKey(entity); + } + + /// + /// Obtains the which was read for the + /// given . + /// + /// The for which a read + /// operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has + /// been registered for . + /// Use to find out whether a + /// read operation has been registered for . + internal HeightStructure Get(HeightStructureEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return heightStructures[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + + #region HeightStructuresCalculationEntity: Read, Contains, Get + + /// + /// Registers a read operation for + /// and the that was constructed + /// with the information. + /// + /// The + /// that was read. + /// The that + /// was constructed. + /// Thrown when any input parameter is null. + internal void Read(HeightStructuresCalculationEntity entity, StructuresCalculation model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + heightStructuresCalculations[entity] = model; + } + + /// + /// Checks whether a read operation has been registered for a given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool Contains(HeightStructuresCalculationEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return heightStructuresCalculations.ContainsKey(entity); + } + + /// + /// Obtains the which was read + /// for the given . + /// + /// The for which a read + /// operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has + /// been registered for . + /// Use + /// to find out whether a read operation has been registered for . + internal StructuresCalculation Get(HeightStructuresCalculationEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return heightStructuresCalculations[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + + #region ClosingStructureEntity: Read, Contains, Get + + /// + /// Registers a read operation for and the + /// that was constructed with the information. + /// + /// The that was read. + /// The that was constructed. + /// Thrown when any of the input parameters is null. + internal void Read(ClosingStructureEntity entity, ClosingStructure model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + closingStructures[entity] = model; + } + + /// + /// Checks whether a read operation has been registered for a given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool Contains(ClosingStructureEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return closingStructures.ContainsKey(entity); + } + + /// + /// Obtains the which was read for the + /// given . + /// + /// The for which a read + /// operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has + /// been registered for . + /// Use to find out whether a + /// read operation has been registered for . + internal ClosingStructure Get(ClosingStructureEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return closingStructures[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + + #region ClosingStructuresCalculationEntity: Read, Contains, Get + + /// + /// Registers a read operation for + /// and the that was constructed + /// with the information. + /// + /// The + /// that was read. + /// The that + /// was constructed. + /// Thrown when any input parameter is null. + internal void Read(ClosingStructuresCalculationEntity entity, StructuresCalculation model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + closingStructuresCalculations[entity] = model; + } + + /// + /// Checks whether a read operation has been registered for a given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool Contains(ClosingStructuresCalculationEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return closingStructuresCalculations.ContainsKey(entity); + } + + /// + /// Obtains the which was read + /// for the given . + /// + /// The for which a read + /// operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has + /// been registered for . + /// Use + /// to find out whether a read operation has been registered for . + internal StructuresCalculation Get(ClosingStructuresCalculationEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return closingStructuresCalculations[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + + #region StabilityPointStructureEntity: Read, Contains, Get + + /// + /// Registers a read operation for and the + /// that was constructed with the information. + /// + /// The that was read. + /// The that was constructed. + /// Thrown when any of the input parameters is null. + internal void Read(StabilityPointStructureEntity entity, StabilityPointStructure model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + stabilityPointStructures[entity] = model; + } + + /// + /// Checks whether a read operation has been registered for a given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool Contains(StabilityPointStructureEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return stabilityPointStructures.ContainsKey(entity); + } + + /// + /// Obtains the which was read for the + /// given . + /// + /// The for which a read + /// operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has + /// been registered for . + /// Use to find out whether a + /// read operation has been registered for . + internal StabilityPointStructure Get(StabilityPointStructureEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return stabilityPointStructures[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + + #region StabilityPointStructuresCalculationEntity: Read, Contains, Get + + /// + /// Registers a read operation for + /// and the that was constructed + /// with the information. + /// + /// The + /// that was read. + /// The that + /// was constructed. + /// Thrown when any input parameter is null. + internal void Read(StabilityPointStructuresCalculationEntity entity, StructuresCalculation model) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + stabilityPointStructuresCalculations[entity] = model; + } + + /// + /// Checks whether a read operation has been registered for a given . + /// + /// The to check for. + /// true if the was read before, false otherwise. + /// Thrown when is null. + internal bool Contains(StabilityPointStructuresCalculationEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return stabilityPointStructuresCalculations.ContainsKey(entity); + } + + /// + /// Obtains the which was read + /// for the given . + /// + /// The for which a read + /// operation has been registered. + /// The constructed . + /// Thrown when is null. + /// Thrown when no read operation has + /// been registered for . + /// Use + /// to find out whether a read operation has been registered for . + internal StructuresCalculation Get(StabilityPointStructuresCalculationEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + try + { + return stabilityPointStructuresCalculations[entity]; + } + catch (KeyNotFoundException e) + { + throw new InvalidOperationException(e.Message, e); + } + } + + #endregion + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityPointStructures/StabilityPointStructureEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityPointStructures/StabilityPointStructureEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityPointStructures/StabilityPointStructureEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,169 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using Core.Common.Base.Geometry; +using Ringtoets.StabilityPointStructures.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.StabilityPointStructures +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class StabilityPointStructureEntityReadExtensions + { + /// + /// Reads the and use the information to update a + /// . + /// + /// The to create for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + internal static StabilityPointStructure Read(this StabilityPointStructureEntity entity, ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (collector.Contains(entity)) + { + return collector.Get(entity); + } + + var structure = new StabilityPointStructure(new StabilityPointStructure.ConstructionProperties + { + Name = entity.Name, + Id = entity.Id, + Location = new Point2D(entity.X.ToNullAsNaN(), entity.Y.ToNullAsNaN()), + StructureNormalOrientation = (RoundedDouble) entity.StructureNormalOrientation.ToNullAsNaN(), + StorageStructureArea = + { + Mean = (RoundedDouble) entity.StorageStructureAreaMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.StorageStructureAreaCoefficientOfVariation.ToNullAsNaN() + }, + AllowedLevelIncreaseStorage = + { + Mean = (RoundedDouble) entity.AllowedLevelIncreaseStorageMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.AllowedLevelIncreaseStorageStandardDeviation.ToNullAsNaN() + }, + FlowWidthAtBottomProtection = + { + Mean = (RoundedDouble) entity.FlowWidthAtBottomProtectionMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.FlowWidthAtBottomProtectionStandardDeviation.ToNullAsNaN() + }, + InsideWaterLevel = + { + Mean = (RoundedDouble) entity.InsideWaterLevelMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.InsideWaterLevelStandardDeviation.ToNullAsNaN() + }, + ThresholdHeightOpenWeir = + { + Mean = (RoundedDouble) entity.ThresholdHeightOpenWeirMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.ThresholdHeightOpenWeirStandardDeviation.ToNullAsNaN() + }, + CriticalOvertoppingDischarge = + { + Mean = (RoundedDouble) entity.CriticalOvertoppingDischargeMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.CriticalOvertoppingDischargeCoefficientOfVariation.ToNullAsNaN() + }, + WidthFlowApertures = + { + Mean = (RoundedDouble) entity.WidthFlowAperturesMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.WidthFlowAperturesStandardDeviation.ToNullAsNaN() + }, + ConstructiveStrengthLinearLoadModel = + { + Mean = (RoundedDouble) entity.ConstructiveStrengthLinearLoadModelMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.ConstructiveStrengthLinearLoadModelCoefficientOfVariation.ToNullAsNaN() + }, + ConstructiveStrengthQuadraticLoadModel = + { + Mean = (RoundedDouble) entity.ConstructiveStrengthQuadraticLoadModelMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.ConstructiveStrengthQuadraticLoadModelCoefficientOfVariation.ToNullAsNaN() + }, + BankWidth = + { + Mean = (RoundedDouble) entity.BankWidthMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.BankWidthStandardDeviation.ToNullAsNaN() + }, + InsideWaterLevelFailureConstruction = + { + Mean = (RoundedDouble) entity.InsideWaterLevelFailureConstructionMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.InsideWaterLevelFailureConstructionStandardDeviation.ToNullAsNaN() + }, + EvaluationLevel = (RoundedDouble) entity.EvaluationLevel.ToNullAsNaN(), + LevelCrestStructure = + { + Mean = (RoundedDouble) entity.LevelCrestStructureMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.LevelCrestStructureStandardDeviation.ToNullAsNaN() + }, + VerticalDistance = (RoundedDouble) entity.VerticalDistance.ToNullAsNaN(), + FailureProbabilityRepairClosure = entity.FailureProbabilityRepairClosure.ToNullAsNaN(), + FailureCollisionEnergy = + { + Mean = (RoundedDouble) entity.FailureCollisionEnergyMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.FailureCollisionEnergyCoefficientOfVariation.ToNullAsNaN() + }, + ShipMass = + { + Mean = (RoundedDouble) entity.ShipMassMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.ShipMassCoefficientOfVariation.ToNullAsNaN() + }, + ShipVelocity = + { + Mean = (RoundedDouble) entity.ShipVelocityMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.ShipVelocityCoefficientOfVariation.ToNullAsNaN() + }, + LevellingCount = entity.LevellingCount, + ProbabilityCollisionSecondaryStructure = entity.ProbabilityCollisionSecondaryStructure.ToNullAsNaN(), + FlowVelocityStructureClosable = + { + Mean = (RoundedDouble) entity.FlowVelocityStructureClosableMean.ToNullAsNaN() + }, + StabilityLinearLoadModel = + { + Mean = (RoundedDouble) entity.StabilityLinearLoadModelMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.StabilityLinearLoadModelCoefficientOfVariation.ToNullAsNaN() + }, + StabilityQuadraticLoadModel = + { + Mean = (RoundedDouble) entity.StabilityQuadraticLoadModelMean.ToNullAsNaN(), + CoefficientOfVariation = (RoundedDouble) entity.StabilityQuadraticLoadModelCoefficientOfVariation.ToNullAsNaN() + }, + AreaFlowApertures = + { + Mean = (RoundedDouble) entity.AreaFlowAperturesMean.ToNullAsNaN(), + StandardDeviation = (RoundedDouble) entity.AreaFlowAperturesStandardDeviation.ToNullAsNaN() + }, + InflowModelType = (StabilityPointStructureInflowModelType) entity.InflowModelType + }); + + collector.Read(entity, structure); + + return structure; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityPointStructures/StabilityPointStructureFailureMechanismMetaEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityPointStructures/StabilityPointStructureFailureMechanismMetaEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityPointStructures/StabilityPointStructureFailureMechanismMetaEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,56 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using Ringtoets.StabilityPointStructures.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.StabilityPointStructures +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class StabilityPointStructureFailureMechanismMetaEntityReadExtensions + { + /// + /// Read the and use the information + /// to construct a . + /// + /// The to + /// create for. + /// A new . + /// Thrown when is null. + internal static GeneralStabilityPointStructuresInput Read(this StabilityPointStructuresFailureMechanismMetaEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return new GeneralStabilityPointStructuresInput + { + N = (RoundedDouble) entity.N + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityPointStructures/StabilityPointStructuresCalculationEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityPointStructures/StabilityPointStructuresCalculationEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityPointStructures/StabilityPointStructuresCalculationEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,140 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Linq; +using Core.Common.Base.Data; +using Ringtoets.Common.Data.Structures; +using Ringtoets.StabilityPointStructures.Data; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Read.IllustrationPoints; + +namespace Ringtoets.Storage.Core.Read.StabilityPointStructures +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class StabilityPointStructuresCalculationEntityReadExtensions + { + /// + /// Reads the and use the + /// information to update a . + /// + /// The + /// to create for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when is null. + internal static StructuresCalculation Read(this StabilityPointStructuresCalculationEntity entity, + ReadConversionCollector collector) + { + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (collector.Contains(entity)) + { + return collector.Get(entity); + } + + var calculation = new StructuresCalculation + { + Name = entity.Name, + Comments = + { + Body = entity.Comments + } + }; + ReadInputParameters(calculation.InputParameters, entity, collector); + ReadOutput(calculation, entity); + + collector.Read(entity, calculation); + + return calculation; + } + + private static void ReadInputParameters(StabilityPointStructuresInput inputParameters, + StabilityPointStructuresCalculationEntity entity, + ReadConversionCollector collector) + { + if (entity.StabilityPointStructureEntity != null) + { + inputParameters.Structure = entity.StabilityPointStructureEntity.Read(collector); + } + + entity.Read(inputParameters, collector); + + inputParameters.InsideWaterLevel.Mean = (RoundedDouble) entity.InsideWaterLevelMean.ToNullAsNaN(); + inputParameters.InsideWaterLevel.StandardDeviation = (RoundedDouble) entity.InsideWaterLevelStandardDeviation.ToNullAsNaN(); + inputParameters.ThresholdHeightOpenWeir.Mean = (RoundedDouble) entity.ThresholdHeightOpenWeirMean.ToNullAsNaN(); + inputParameters.ThresholdHeightOpenWeir.StandardDeviation = (RoundedDouble) entity.ThresholdHeightOpenWeirStandardDeviation.ToNullAsNaN(); + inputParameters.ConstructiveStrengthLinearLoadModel.Mean = (RoundedDouble) entity.ConstructiveStrengthLinearLoadModelMean.ToNullAsNaN(); + inputParameters.ConstructiveStrengthLinearLoadModel.CoefficientOfVariation = (RoundedDouble) entity.ConstructiveStrengthLinearLoadModelCoefficientOfVariation.ToNullAsNaN(); + inputParameters.ConstructiveStrengthQuadraticLoadModel.Mean = (RoundedDouble) entity.ConstructiveStrengthQuadraticLoadModelMean.ToNullAsNaN(); + inputParameters.ConstructiveStrengthQuadraticLoadModel.CoefficientOfVariation = (RoundedDouble) entity.ConstructiveStrengthQuadraticLoadModelCoefficientOfVariation.ToNullAsNaN(); + inputParameters.BankWidth.Mean = (RoundedDouble) entity.BankWidthMean.ToNullAsNaN(); + inputParameters.BankWidth.StandardDeviation = (RoundedDouble) entity.BankWidthStandardDeviation.ToNullAsNaN(); + inputParameters.InsideWaterLevelFailureConstruction.Mean = (RoundedDouble) entity.InsideWaterLevelFailureConstructionMean.ToNullAsNaN(); + inputParameters.InsideWaterLevelFailureConstruction.StandardDeviation = (RoundedDouble) entity.InsideWaterLevelFailureConstructionStandardDeviation.ToNullAsNaN(); + inputParameters.EvaluationLevel = (RoundedDouble) entity.EvaluationLevel.ToNullAsNaN(); + inputParameters.LevelCrestStructure.Mean = (RoundedDouble) entity.LevelCrestStructureMean.ToNullAsNaN(); + inputParameters.LevelCrestStructure.StandardDeviation = (RoundedDouble) entity.LevelCrestStructureStandardDeviation.ToNullAsNaN(); + inputParameters.VerticalDistance = (RoundedDouble) entity.VerticalDistance.ToNullAsNaN(); + inputParameters.FailureProbabilityRepairClosure = entity.FailureProbabilityRepairClosure; + inputParameters.FailureCollisionEnergy.Mean = (RoundedDouble) entity.FailureCollisionEnergyMean.ToNullAsNaN(); + inputParameters.FailureCollisionEnergy.CoefficientOfVariation = (RoundedDouble) entity.FailureCollisionEnergyCoefficientOfVariation.ToNullAsNaN(); + inputParameters.ShipMass.Mean = (RoundedDouble) entity.ShipMassMean.ToNullAsNaN(); + inputParameters.ShipMass.CoefficientOfVariation = (RoundedDouble) entity.ShipMassCoefficientOfVariation.ToNullAsNaN(); + inputParameters.ShipVelocity.Mean = (RoundedDouble) entity.ShipVelocityMean.ToNullAsNaN(); + inputParameters.ShipVelocity.CoefficientOfVariation = (RoundedDouble) entity.ShipVelocityCoefficientOfVariation.ToNullAsNaN(); + inputParameters.LevellingCount = entity.LevellingCount; + inputParameters.ProbabilityCollisionSecondaryStructure = entity.ProbabilityCollisionSecondaryStructure; + inputParameters.FlowVelocityStructureClosable.Mean = (RoundedDouble) entity.FlowVelocityStructureClosableMean.ToNullAsNaN(); + inputParameters.StabilityLinearLoadModel.Mean = (RoundedDouble) entity.StabilityLinearLoadModelMean.ToNullAsNaN(); + inputParameters.StabilityLinearLoadModel.CoefficientOfVariation = (RoundedDouble) entity.StabilityLinearLoadModelCoefficientOfVariation.ToNullAsNaN(); + inputParameters.StabilityQuadraticLoadModel.Mean = (RoundedDouble) entity.StabilityQuadraticLoadModelMean.ToNullAsNaN(); + inputParameters.StabilityQuadraticLoadModel.CoefficientOfVariation = (RoundedDouble) entity.StabilityQuadraticLoadModelCoefficientOfVariation.ToNullAsNaN(); + inputParameters.AreaFlowApertures.Mean = (RoundedDouble) entity.AreaFlowAperturesMean.ToNullAsNaN(); + inputParameters.AreaFlowApertures.StandardDeviation = (RoundedDouble) entity.AreaFlowAperturesStandardDeviation.ToNullAsNaN(); + inputParameters.InflowModelType = (StabilityPointStructureInflowModelType) entity.InflowModelType; + inputParameters.LoadSchematizationType = (LoadSchematizationType) entity.LoadSchematizationType; + inputParameters.VolumicWeightWater = (RoundedDouble) entity.VolumicWeightWater.ToNullAsNaN(); + inputParameters.FactorStormDurationOpenStructure = (RoundedDouble) entity.FactorStormDurationOpenStructure.ToNullAsNaN(); + inputParameters.DrainCoefficient.Mean = (RoundedDouble) entity.DrainCoefficientMean.ToNullAsNaN(); + } + + private static void ReadOutput(StructuresCalculation calculation, + StabilityPointStructuresCalculationEntity entity) + { + StabilityPointStructuresOutputEntity outputEntity = entity.StabilityPointStructuresOutputEntities.FirstOrDefault(); + if (outputEntity == null) + { + return; + } + + var output = new StructuresOutput(outputEntity.Reliability.ToNullAsNaN(), + outputEntity.GeneralResultFaultTreeIllustrationPointEntity?.Read()); + calculation.Output = output; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityPointStructures/StabilityPointStructuresSectionResultEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityPointStructures/StabilityPointStructuresSectionResultEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityPointStructures/StabilityPointStructuresSectionResultEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,76 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Primitives; +using Ringtoets.StabilityPointStructures.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.StabilityPointStructures +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class StabilityPointStructuresSectionResultEntityReadExtensions + { + /// + /// Reads the and use the information to update a + /// . + /// + /// The used + /// to update the . + /// The target of the read operation. + /// The object keeping track of read operations. + /// Thrown when any input parameter is null. + internal static void Read(this StabilityPointStructuresSectionResultEntity entity, + StabilityPointStructuresFailureMechanismSectionResult sectionResult, + ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (sectionResult == null) + { + throw new ArgumentNullException(nameof(sectionResult)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + sectionResult.SimpleAssessmentResult = (SimpleAssessmentValidityOnlyResultType) entity.SimpleAssessmentResult; + sectionResult.DetailedAssessmentResult = (DetailedAssessmentProbabilityOnlyResultType) entity.DetailedAssessmentResult; + sectionResult.TailorMadeAssessmentResult = (TailorMadeAssessmentProbabilityCalculationResultType) entity.TailorMadeAssessmentResult; + sectionResult.TailorMadeAssessmentProbability = entity.TailorMadeAssessmentProbability.ToNullAsNaN(); + sectionResult.UseManualAssembly = Convert.ToBoolean(entity.UseManualAssembly); + sectionResult.ManualAssemblyProbability = entity.ManualAssemblyProbability.ToNullAsNaN(); + + if (entity.StabilityPointStructuresCalculationEntity != null) + { + sectionResult.Calculation = entity.StabilityPointStructuresCalculationEntity.Read(collector); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityStoneCover/StabilityStoneCoverFailureMechanismMetaEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityStoneCover/StabilityStoneCoverFailureMechanismMetaEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityStoneCover/StabilityStoneCoverFailureMechanismMetaEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,56 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using Ringtoets.StabilityStoneCover.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.StabilityStoneCover +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class StabilityStoneCoverFailureMechanismMetaEntityReadExtensions + { + /// + /// Read the and use the information to + /// construct a . + /// + /// The to create + /// for. + /// A new . + /// Thrown when is null. + internal static GeneralStabilityStoneCoverWaveConditionsInput Read(this StabilityStoneCoverFailureMechanismMetaEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return new GeneralStabilityStoneCoverWaveConditionsInput + { + N = (RoundedDouble) entity.N + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityStoneCover/StabilityStoneCoverSectionResultEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityStoneCover/StabilityStoneCoverSectionResultEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityStoneCover/StabilityStoneCoverSectionResultEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,67 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.AssemblyTool.Data; +using Ringtoets.Common.Primitives; +using Ringtoets.StabilityStoneCover.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.StabilityStoneCover +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class StabilityStoneCoverSectionResultEntityReadExtensions + { + /// + /// Reads the and use the information to update a + /// . + /// + /// The used + /// to update . + /// The target of the read operation. + /// Thrown when any parameter is null. + internal static void Read(this StabilityStoneCoverSectionResultEntity entity, StabilityStoneCoverFailureMechanismSectionResult sectionResult) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (sectionResult == null) + { + throw new ArgumentNullException(nameof(sectionResult)); + } + + sectionResult.SimpleAssessmentResult = (SimpleAssessmentValidityOnlyResultType) entity.SimpleAssessmentResult; + sectionResult.DetailedAssessmentResultForFactorizedSignalingNorm = (DetailedAssessmentResultType) entity.DetailedAssessmentResultForFactorizedSignalingNorm; + sectionResult.DetailedAssessmentResultForSignalingNorm = (DetailedAssessmentResultType) entity.DetailedAssessmentResultForSignalingNorm; + sectionResult.DetailedAssessmentResultForMechanismSpecificLowerLimitNorm = (DetailedAssessmentResultType) entity.DetailedAssessmentResultForMechanismSpecificLowerLimitNorm; + sectionResult.DetailedAssessmentResultForLowerLimitNorm = (DetailedAssessmentResultType) entity.DetailedAssessmentResultForLowerLimitNorm; + sectionResult.DetailedAssessmentResultForFactorizedLowerLimitNorm = (DetailedAssessmentResultType) entity.DetailedAssessmentResultForFactorizedLowerLimitNorm; + sectionResult.TailorMadeAssessmentResult = (TailorMadeAssessmentCategoryGroupResultType) entity.TailorMadeAssessmentResult; + sectionResult.UseManualAssembly = Convert.ToBoolean(entity.UseManualAssembly); + sectionResult.ManualAssemblyCategoryGroup = (FailureMechanismSectionAssemblyCategoryGroup) entity.ManualAssemblyCategoryGroup; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityStoneCover/StabilityStoneCoverWaveConditionsCalculationEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityStoneCover/StabilityStoneCoverWaveConditionsCalculationEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityStoneCover/StabilityStoneCoverWaveConditionsCalculationEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,131 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using Core.Common.Base.Data; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Revetment.Data; +using Ringtoets.StabilityStoneCover.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.StabilityStoneCover +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class StabilityStoneCoverWaveConditionsCalculationEntityReadExtensions + { + /// + /// Reads the and use the + /// information to update a . + /// + /// The + /// to create for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when any parameter is null. + internal static StabilityStoneCoverWaveConditionsCalculation Read(this StabilityStoneCoverWaveConditionsCalculationEntity entity, ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + var calculation = new StabilityStoneCoverWaveConditionsCalculation + { + Name = entity.Name, + Comments = + { + Body = entity.Comments + } + }; + ReadCalculationInputs(calculation.InputParameters, entity, collector); + ReadCalculationOutputs(entity, calculation); + + return calculation; + } + + private static void ReadCalculationInputs(AssessmentSectionCategoryWaveConditionsInput inputParameters, + StabilityStoneCoverWaveConditionsCalculationEntity entity, + ReadConversionCollector collector) + { + inputParameters.ForeshoreProfile = GetDikeProfileValue(entity.ForeshoreProfileEntity, collector); + inputParameters.HydraulicBoundaryLocation = GetHydraulicBoundaryLocationValue(entity.HydraulicLocationEntity, collector); + inputParameters.Orientation = (RoundedDouble) entity.Orientation.ToNullAsNaN(); + inputParameters.UseForeshore = Convert.ToBoolean(entity.UseForeshore); + inputParameters.UseBreakWater = Convert.ToBoolean(entity.UseBreakWater); + inputParameters.BreakWater.Height = (RoundedDouble) entity.BreakWaterHeight.ToNullAsNaN(); + inputParameters.BreakWater.Type = (BreakWaterType) entity.BreakWaterType; + inputParameters.UpperBoundaryRevetment = (RoundedDouble) entity.UpperBoundaryRevetment.ToNullAsNaN(); + inputParameters.LowerBoundaryRevetment = (RoundedDouble) entity.LowerBoundaryRevetment.ToNullAsNaN(); + inputParameters.UpperBoundaryWaterLevels = (RoundedDouble) entity.UpperBoundaryWaterLevels.ToNullAsNaN(); + inputParameters.LowerBoundaryWaterLevels = (RoundedDouble) entity.LowerBoundaryWaterLevels.ToNullAsNaN(); + inputParameters.StepSize = (WaveConditionsInputStepSize) entity.StepSize; + inputParameters.CategoryType = (AssessmentSectionCategoryType) entity.CategoryType; + } + + private static void ReadCalculationOutputs(StabilityStoneCoverWaveConditionsCalculationEntity entity, StabilityStoneCoverWaveConditionsCalculation calculation) + { + if (!entity.StabilityStoneCoverWaveConditionsOutputEntities.Any()) + { + return; + } + + var columnsOutput = new List(); + var blocksOutput = new List(); + + foreach (StabilityStoneCoverWaveConditionsOutputEntity conditionsOutputEntity in entity.StabilityStoneCoverWaveConditionsOutputEntities.OrderBy(oe => oe.Order)) + { + WaveConditionsOutput output = conditionsOutputEntity.Read(); + if (conditionsOutputEntity.OutputType == Convert.ToByte(WaveConditionsOutputType.Columns)) + { + columnsOutput.Add(output); + } + else if (conditionsOutputEntity.OutputType == Convert.ToByte(WaveConditionsOutputType.Blocks)) + { + blocksOutput.Add(output); + } + } + + calculation.Output = new StabilityStoneCoverWaveConditionsOutput(columnsOutput, blocksOutput); + } + + private static ForeshoreProfile GetDikeProfileValue(ForeshoreProfileEntity foreshoreProfileEntity, ReadConversionCollector collector) + { + return foreshoreProfileEntity?.Read(collector); + } + + private static HydraulicBoundaryLocation GetHydraulicBoundaryLocationValue(HydraulicLocationEntity hydraulicLocationEntity, ReadConversionCollector collector) + { + return hydraulicLocationEntity?.Read(collector); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityStoneCover/StabilityStoneCoverWaveConditionsOutputEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityStoneCover/StabilityStoneCoverWaveConditionsOutputEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StabilityStoneCover/StabilityStoneCoverWaveConditionsOutputEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,56 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Revetment.Data; +using Ringtoets.StabilityStoneCover.Data; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read.StabilityStoneCover +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class StabilityStoneCoverWaveConditionsOutputEntityReadExtensions + { + /// + /// Reads the + /// and use the information to construct a . + /// + /// The + /// to create for. + /// A new . + internal static WaveConditionsOutput Read(this StabilityStoneCoverWaveConditionsOutputEntity entity) + { + return new WaveConditionsOutput(entity.WaterLevel.ToNullAsNaN(), + entity.WaveHeight.ToNullAsNaN(), + entity.WavePeakPeriod.ToNullAsNaN(), + entity.WaveAngle.ToNullAsNaN(), + entity.WaveDirection.ToNullAsNaN(), + entity.TargetProbability.ToNullAsNaN(), + entity.TargetReliability.ToNullAsNaN(), + entity.CalculatedProbability.ToNullAsNaN(), + entity.CalculatedReliability.ToNullAsNaN(), + (CalculationConvergence) entity.CalculationConvergence); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StochasticSoilModelEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StochasticSoilModelEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StochasticSoilModelEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,147 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using Core.Common.Base.Geometry; +using Ringtoets.MacroStabilityInwards.Data.SoilProfile; +using Ringtoets.Piping.Data.SoilProfile; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Read.MacroStabilityInwards; +using Ringtoets.Storage.Core.Read.Piping; +using Ringtoets.Storage.Core.Serializers; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// This class defines extension methods for read operations for a stochastic soil model + /// based on the . + /// + internal static class StochasticSoilModelEntityReadExtensions + { + /// + /// Reads the and use the information to construct + /// a . + /// + /// The to create for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when any input parameter is null. + /// Thrown when + /// of is empty. + public static PipingStochasticSoilModel ReadAsPipingStochasticSoilModel(this StochasticSoilModelEntity entity, + ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (collector.ContainsPipingStochasticSoilModel(entity)) + { + return collector.GetPipingStochasticSoilModel(entity); + } + + Point2D[] geometry = ReadSegmentPoints(entity.StochasticSoilModelSegmentPointXml).ToArray(); + PipingStochasticSoilProfile[] stochasticSoilProfiles = ReadPipingStochasticSoilProfiles(entity, collector).ToArray(); + var model = new PipingStochasticSoilModel(entity.Name, geometry, stochasticSoilProfiles); + + collector.Read(entity, model); + + return model; + } + + /// + /// Reads the and use the information to construct + /// a . + /// + /// The to create for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when any input parameter is null. + /// Thrown when + /// of is empty. + public static MacroStabilityInwardsStochasticSoilModel ReadAsMacroStabilityInwardsStochasticSoilModel(this StochasticSoilModelEntity entity, + ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (collector.ContainsMacroStabilityInwardsStochasticSoilModel(entity)) + { + return collector.GetMacroStabilityInwardsStochasticSoilModel(entity); + } + + Point2D[] geometry = ReadSegmentPoints(entity.StochasticSoilModelSegmentPointXml).ToArray(); + MacroStabilityInwardsStochasticSoilProfile[] stochasticSoilProfiles = entity.ReadMacroStabilityInwardsStochasticSoilProfiles(collector) + .ToArray(); + var model = new MacroStabilityInwardsStochasticSoilModel(entity.Name, geometry, stochasticSoilProfiles); + + collector.Read(entity, model); + + return model; + } + + private static IEnumerable ReadPipingStochasticSoilProfiles(this StochasticSoilModelEntity entity, + ReadConversionCollector collector) + { + foreach (PipingStochasticSoilProfileEntity stochasticSoilProfileEntity in entity.PipingStochasticSoilProfileEntities + .OrderBy(ssp => ssp.Order)) + { + yield return stochasticSoilProfileEntity.Read(collector); + } + } + + private static IEnumerable ReadMacroStabilityInwardsStochasticSoilProfiles(this StochasticSoilModelEntity entity, + ReadConversionCollector collector) + { + foreach (MacroStabilityInwardsStochasticSoilProfileEntity stochasticSoilProfileEntity in entity.MacroStabilityInwardsStochasticSoilProfileEntities + .OrderBy(ssp => ssp.Order)) + { + yield return stochasticSoilProfileEntity.Read(collector); + } + } + + /// + /// Reads the segment points. + /// + /// The xml containing a collection of . + /// The read segment points. + /// Thrown when is empty. + private static IEnumerable ReadSegmentPoints(string xml) + { + return new Point2DCollectionXmlSerializer().FromXml(xml); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,61 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Primitives; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensions + { + /// + /// Reads the and use the information to update a + /// . + /// + /// The used to update . + /// The target of the read operation. + /// Thrown when any parameter is null. + internal static void Read(this StrengthStabilityLengthwiseConstructionSectionResultEntity entity, + StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult sectionResult) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (sectionResult == null) + { + throw new ArgumentNullException(nameof(sectionResult)); + } + + sectionResult.SimpleAssessmentResult = (SimpleAssessmentResultType) entity.SimpleAssessmentResult; + sectionResult.TailorMadeAssessmentResult = (TailorMadeAssessmentResultType) entity.TailorMadeAssessmentResult; + sectionResult.UseManualAssembly = Convert.ToBoolean(entity.UseManualAssembly); + sectionResult.ManualAssemblyCategoryGroup = (ManualFailureMechanismSectionAssemblyCategoryGroup) entity.ManualAssemblyCategoryGroup; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StructureCalculationEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StructureCalculationEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/StructureCalculationEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,93 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using Ringtoets.Common.Data; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.Common.Data.Structures; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// This class defines extension methods for read operations for the common code + /// among all instances based on the . + /// + internal static class StructureCalculationEntityReadExtensions + { + /// + /// Reads all the information from the entity and updated the given input object, + /// with the exception of the property. + /// + /// The type of structure residing in . + /// The entity. + /// The input object to update. + /// The object keeping track of read operations. + /// Thrown when + /// or is null. + internal static void Read(this IStructuresCalculationEntity entity, + StructuresInputBase inputToUpdate, + ReadConversionCollector collector) where T : StructureBase + { + if (inputToUpdate == null) + { + throw new ArgumentNullException(nameof(inputToUpdate)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (entity.ForeshoreProfileEntity != null) + { + inputToUpdate.ForeshoreProfile = entity.ForeshoreProfileEntity.Read(collector); + } + + if (entity.HydraulicLocationEntity != null) + { + inputToUpdate.HydraulicBoundaryLocation = entity.HydraulicLocationEntity.Read(collector); + } + + inputToUpdate.StructureNormalOrientation = (RoundedDouble) entity.StructureNormalOrientation.ToNullAsNaN(); + inputToUpdate.AllowedLevelIncreaseStorage.Mean = (RoundedDouble) entity.AllowedLevelIncreaseStorageMean.ToNullAsNaN(); + inputToUpdate.AllowedLevelIncreaseStorage.StandardDeviation = (RoundedDouble) entity.AllowedLevelIncreaseStorageStandardDeviation.ToNullAsNaN(); + inputToUpdate.StorageStructureArea.Mean = (RoundedDouble) entity.StorageStructureAreaMean.ToNullAsNaN(); + inputToUpdate.StorageStructureArea.CoefficientOfVariation = (RoundedDouble) entity.StorageStructureAreaCoefficientOfVariation.ToNullAsNaN(); + inputToUpdate.FlowWidthAtBottomProtection.Mean = (RoundedDouble) entity.FlowWidthAtBottomProtectionMean.ToNullAsNaN(); + inputToUpdate.FlowWidthAtBottomProtection.StandardDeviation = (RoundedDouble) entity.FlowWidthAtBottomProtectionStandardDeviation.ToNullAsNaN(); + inputToUpdate.CriticalOvertoppingDischarge.Mean = (RoundedDouble) entity.CriticalOvertoppingDischargeMean.ToNullAsNaN(); + inputToUpdate.CriticalOvertoppingDischarge.CoefficientOfVariation = (RoundedDouble) entity.CriticalOvertoppingDischargeCoefficientOfVariation.ToNullAsNaN(); + inputToUpdate.FailureProbabilityStructureWithErosion = entity.FailureProbabilityStructureWithErosion; + inputToUpdate.WidthFlowApertures.Mean = (RoundedDouble) entity.WidthFlowAperturesMean.ToNullAsNaN(); + inputToUpdate.WidthFlowApertures.StandardDeviation = (RoundedDouble) entity.WidthFlowAperturesStandardDeviation.ToNullAsNaN(); + inputToUpdate.StormDuration.Mean = (RoundedDouble) entity.StormDurationMean.ToNullAsNaN(); + + inputToUpdate.UseBreakWater = Convert.ToBoolean(entity.UseBreakWater); + inputToUpdate.BreakWater.Type = (BreakWaterType) entity.BreakWaterType; + inputToUpdate.BreakWater.Height = (RoundedDouble) entity.BreakWaterHeight.ToNullAsNaN(); + inputToUpdate.UseForeshore = Convert.ToBoolean(entity.UseForeshore); + + inputToUpdate.ShouldIllustrationPointsBeCalculated = Convert.ToBoolean(entity.ShouldIllustrationPointsBeCalculated); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/SurfaceLineEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/SurfaceLineEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/SurfaceLineEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,304 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using Core.Common.Base.Geometry; +using Core.Common.Util.Extensions; +using Ringtoets.MacroStabilityInwards.Primitives; +using Ringtoets.Piping.Primitives; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Serializers; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// This class defines extension methods for read operations for a surface line + /// based on the . + /// + internal static class SurfaceLineEntityReadExtensions + { + /// + /// Read the and use the information to construct + /// a . + /// + /// The to create + /// for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when any input parameter is null. + /// Thrown when + /// of is empty. + /// Thrown when the + /// contains an invalid type of characteristic point. + /// Thrown when the contains a + /// characteristic point that is not supported. + public static PipingSurfaceLine ReadAsPipingSurfaceLine(this SurfaceLineEntity entity, + ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (collector.ContainsPipingSurfaceLine(entity)) + { + return collector.GetPipingSurfaceLine(entity); + } + + var surfaceLine = new PipingSurfaceLine(entity.Name) + { + ReferenceLineIntersectionWorldPoint = GetReferenceLineIntersectionWorldPoint(entity) + }; + + surfaceLine.SetGeometry(ReadGeometryPoints(entity.PointsXml)); + entity.ReadCharacteristicPoints(surfaceLine); + + collector.Read(entity, surfaceLine); + + return surfaceLine; + } + + /// + /// Read the and use the information to construct + /// a . + /// + /// The to create + /// for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when any input parameter is null. + /// Thrown when + /// of is empty. + /// Thrown when the + /// contains an invalid type of characteristic point. + /// Thrown when the contains a + /// characteristic point that is not supported. + public static MacroStabilityInwardsSurfaceLine ReadAsMacroStabilityInwardsSurfaceLine( + this SurfaceLineEntity entity, + ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + if (collector.ContainsMacroStabilityInwardsSurfaceLine(entity)) + { + return collector.GetMacroStabilityInwardsSurfaceLine(entity); + } + + var surfaceLine = new MacroStabilityInwardsSurfaceLine(entity.Name) + { + ReferenceLineIntersectionWorldPoint = GetReferenceLineIntersectionWorldPoint(entity) + }; + + surfaceLine.SetGeometry(ReadGeometryPoints(entity.PointsXml)); + entity.ReadCharacteristicPoints(surfaceLine); + + collector.Read(entity, surfaceLine); + + return surfaceLine; + } + + private static Point2D GetReferenceLineIntersectionWorldPoint(SurfaceLineEntity entity) + { + return new Point2D(entity.ReferenceLineIntersectionX.ToNullAsNaN(), + entity.ReferenceLineIntersectionY.ToNullAsNaN()); + } + + /// + /// Reads the characteristic points from the and sets these + /// to the . + /// + /// The entity to read. + /// The surface line to set the characteristic point on. + /// Thrown when the + /// contains an invalid type of characteristic point. + /// Thrown when the contains a + /// characteristic point that is not supported. + private static void ReadCharacteristicPoints(this SurfaceLineEntity entity, PipingSurfaceLine surfaceLine) + { + var characteristicPoints = new Dictionary(); + foreach (PipingCharacteristicPointEntity pointEntity in entity.PipingCharacteristicPointEntities) + { + characteristicPoints[(PipingCharacteristicPointType) pointEntity.Type] = new Point3D(pointEntity.X.ToNullAsNaN(), + pointEntity.Y.ToNullAsNaN(), + pointEntity.Z.ToNullAsNaN()); + } + + characteristicPoints.ForEachElementDo(cp => SetCharacteristicPoint(surfaceLine, cp.Key, cp.Value)); + } + + /// + /// Reads the characteristic points from the and sets these + /// to the . + /// + /// The entity to read. + /// The surface line to set the characteristic point on. + /// Thrown when the + /// contains an invalid type of characteristic point. + /// Thrown when the contains a + /// characteristic point that is not supported. + private static void ReadCharacteristicPoints(this SurfaceLineEntity entity, MacroStabilityInwardsSurfaceLine surfaceLine) + { + var characteristicPoints = new Dictionary(); + foreach (MacroStabilityInwardsCharacteristicPointEntity pointEntity in entity.MacroStabilityInwardsCharacteristicPointEntities) + { + characteristicPoints[(MacroStabilityInwardsCharacteristicPointType) pointEntity.Type] = new Point3D(pointEntity.X.ToNullAsNaN(), + pointEntity.Y.ToNullAsNaN(), + pointEntity.Z.ToNullAsNaN()); + } + + characteristicPoints.ForEachElementDo(cp => SetCharacteristicPoint(surfaceLine, cp.Key, cp.Value)); + } + + /// + /// Sets the characteristic point and its coordinate to the . + /// + /// The surface line to set the characteristic point on. + /// The type of characteristic point. + /// The point associated with the characteristic point. + /// Thrown when is not + /// a valid . + /// Thrown when is not supported. + private static void SetCharacteristicPoint(PipingSurfaceLine surfaceLine, + PipingCharacteristicPointType type, + Point3D geometryPoint) + { + if (!Enum.IsDefined(typeof(PipingCharacteristicPointType), type)) + { + throw new InvalidEnumArgumentException(nameof(type), + (int) type, + typeof(PipingCharacteristicPointType)); + } + + switch (type) + { + case PipingCharacteristicPointType.DikeToeAtRiver: + surfaceLine.SetDikeToeAtRiverAt(geometryPoint); + break; + case PipingCharacteristicPointType.DikeToeAtPolder: + surfaceLine.SetDikeToeAtPolderAt(geometryPoint); + break; + case PipingCharacteristicPointType.DitchDikeSide: + surfaceLine.SetDitchDikeSideAt(geometryPoint); + break; + case PipingCharacteristicPointType.BottomDitchDikeSide: + surfaceLine.SetBottomDitchDikeSideAt(geometryPoint); + break; + case PipingCharacteristicPointType.BottomDitchPolderSide: + surfaceLine.SetBottomDitchPolderSideAt(geometryPoint); + break; + case PipingCharacteristicPointType.DitchPolderSide: + surfaceLine.SetDitchPolderSideAt(geometryPoint); + break; + default: + throw new NotSupportedException(); + } + } + + /// + /// Sets the characteristic point and its coordinate to the . + /// + /// The surface line to set the characteristic point on. + /// The type of characteristic point. + /// The point associated with the characteristic point. + /// Thrown when is not + /// a valid . + /// Thrown when is not supported. + private static void SetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine, + MacroStabilityInwardsCharacteristicPointType type, + Point3D geometryPoint) + { + if (!Enum.IsDefined(typeof(MacroStabilityInwardsCharacteristicPointType), type)) + { + throw new InvalidEnumArgumentException(nameof(type), + (int) type, + typeof(MacroStabilityInwardsCharacteristicPointType)); + } + + switch (type) + { + case MacroStabilityInwardsCharacteristicPointType.SurfaceLevelOutside: + surfaceLine.SetSurfaceLevelOutsideAt(geometryPoint); + break; + case MacroStabilityInwardsCharacteristicPointType.SurfaceLevelInside: + surfaceLine.SetSurfaceLevelInsideAt(geometryPoint); + break; + case MacroStabilityInwardsCharacteristicPointType.ShoulderBaseInside: + surfaceLine.SetShoulderBaseInsideAt(geometryPoint); + break; + case MacroStabilityInwardsCharacteristicPointType.ShoulderTopInside: + surfaceLine.SetShoulderTopInsideAt(geometryPoint); + break; + case MacroStabilityInwardsCharacteristicPointType.DikeToeAtRiver: + surfaceLine.SetDikeToeAtRiverAt(geometryPoint); + break; + case MacroStabilityInwardsCharacteristicPointType.DikeToeAtPolder: + surfaceLine.SetDikeToeAtPolderAt(geometryPoint); + break; + case MacroStabilityInwardsCharacteristicPointType.BottomDitchDikeSide: + surfaceLine.SetBottomDitchDikeSideAt(geometryPoint); + break; + case MacroStabilityInwardsCharacteristicPointType.BottomDitchPolderSide: + surfaceLine.SetBottomDitchPolderSideAt(geometryPoint); + break; + case MacroStabilityInwardsCharacteristicPointType.DitchDikeSide: + surfaceLine.SetDitchDikeSideAt(geometryPoint); + break; + case MacroStabilityInwardsCharacteristicPointType.DikeTopAtRiver: + surfaceLine.SetDikeTopAtRiverAt(geometryPoint); + break; + case MacroStabilityInwardsCharacteristicPointType.DikeTopAtPolder: + surfaceLine.SetDikeTopAtPolderAt(geometryPoint); + break; + case MacroStabilityInwardsCharacteristicPointType.DitchPolderSide: + surfaceLine.SetDitchPolderSideAt(geometryPoint); + break; + default: + throw new NotSupportedException(); + } + } + + /// + /// Reads the geometry points. + /// + /// The xml containing a collection of . + /// The read geometry points. + /// Thrown when is empty. + private static IEnumerable ReadGeometryPoints(string xml) + { + return new Point3DCollectionXmlSerializer().FromXml(xml); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/TechnicalInnovationSectionResultEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/TechnicalInnovationSectionResultEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/TechnicalInnovationSectionResultEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,60 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Primitives; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class TechnicalInnovationSectionResultEntityReadExtensions + { + /// + /// Reads the and use the information to update a + /// . + /// + /// The used to update . + /// The target of the read operation. + /// Thrown when any parameter is null. + internal static void Read(this TechnicalInnovationSectionResultEntity entity, TechnicalInnovationFailureMechanismSectionResult sectionResult) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (sectionResult == null) + { + throw new ArgumentNullException(nameof(sectionResult)); + } + + sectionResult.SimpleAssessmentResult = (SimpleAssessmentResultType) entity.SimpleAssessmentResult; + sectionResult.TailorMadeAssessmentResult = (TailorMadeAssessmentResultType) entity.TailorMadeAssessmentResult; + sectionResult.UseManualAssembly = Convert.ToBoolean(entity.UseManualAssembly); + sectionResult.ManualAssemblyCategoryGroup = (ManualFailureMechanismSectionAssemblyCategoryGroup) entity.ManualAssemblyCategoryGroup; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/WaterPressureAsphaltCoverSectionResultEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/WaterPressureAsphaltCoverSectionResultEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/WaterPressureAsphaltCoverSectionResultEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,60 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.Common.Primitives; +using Ringtoets.Integration.Data.StandAlone.SectionResults; +using Ringtoets.Storage.Core.DbContext; + +namespace Ringtoets.Storage.Core.Read +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class WaterPressureAsphaltCoverSectionResultEntityReadExtensions + { + /// + /// Reads the and use the information to update a + /// . + /// + /// The used to update . + /// The target of the read operation. + /// Thrown when any parameter is null. + internal static void Read(this WaterPressureAsphaltCoverSectionResultEntity entity, WaterPressureAsphaltCoverFailureMechanismSectionResult sectionResult) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (sectionResult == null) + { + throw new ArgumentNullException(nameof(sectionResult)); + } + + sectionResult.SimpleAssessmentResult = (SimpleAssessmentResultType) entity.SimpleAssessmentResult; + sectionResult.TailorMadeAssessmentResult = (TailorMadeAssessmentResultType) entity.TailorMadeAssessmentResult; + sectionResult.UseManualAssembly = Convert.ToBoolean(entity.UseManualAssembly); + sectionResult.ManualAssemblyCategoryGroup = (ManualFailureMechanismSectionAssemblyCategoryGroup) entity.ManualAssemblyCategoryGroup; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/WaveImpactAsphaltCover/WaveImpactAsphaltCoverFailureMechanismMetaEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/WaveImpactAsphaltCover/WaveImpactAsphaltCoverFailureMechanismMetaEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/WaveImpactAsphaltCover/WaveImpactAsphaltCoverFailureMechanismMetaEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,56 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.WaveImpactAsphaltCover.Data; + +namespace Ringtoets.Storage.Core.Read.WaveImpactAsphaltCover +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class WaveImpactAsphaltCoverFailureMechanismMetaEntityReadExtensions + { + /// + /// Read the and use the information to + /// construct a . + /// + /// The to create + /// for. + /// A new . + /// Thrown when is null. + internal static GeneralWaveImpactAsphaltCoverInput Read(this WaveImpactAsphaltCoverFailureMechanismMetaEntity entity) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + return new GeneralWaveImpactAsphaltCoverInput + { + DeltaL = (RoundedDouble) entity.DeltaL + }; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/WaveImpactAsphaltCover/WaveImpactAsphaltCoverSectionResultEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/WaveImpactAsphaltCover/WaveImpactAsphaltCoverSectionResultEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/WaveImpactAsphaltCover/WaveImpactAsphaltCoverSectionResultEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,67 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.AssemblyTool.Data; +using Ringtoets.Common.Primitives; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.WaveImpactAsphaltCover.Data; + +namespace Ringtoets.Storage.Core.Read.WaveImpactAsphaltCover +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class WaveImpactAsphaltCoverSectionResultEntityReadExtensions + { + /// + /// Reads the and use the information to update a + /// . + /// + /// The used to update . + /// The target of the read operation. + /// A new . + /// Thrown when any parameter is null. + internal static void Read(this WaveImpactAsphaltCoverSectionResultEntity entity, WaveImpactAsphaltCoverFailureMechanismSectionResult sectionResult) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (sectionResult == null) + { + throw new ArgumentNullException(nameof(sectionResult)); + } + + sectionResult.SimpleAssessmentResult = (SimpleAssessmentResultType) entity.SimpleAssessmentResult; + sectionResult.DetailedAssessmentResultForFactorizedSignalingNorm = (DetailedAssessmentResultType) entity.DetailedAssessmentResultForFactorizedSignalingNorm; + sectionResult.DetailedAssessmentResultForSignalingNorm = (DetailedAssessmentResultType) entity.DetailedAssessmentResultForSignalingNorm; + sectionResult.DetailedAssessmentResultForMechanismSpecificLowerLimitNorm = (DetailedAssessmentResultType) entity.DetailedAssessmentResultForMechanismSpecificLowerLimitNorm; + sectionResult.DetailedAssessmentResultForLowerLimitNorm = (DetailedAssessmentResultType) entity.DetailedAssessmentResultForLowerLimitNorm; + sectionResult.DetailedAssessmentResultForFactorizedLowerLimitNorm = (DetailedAssessmentResultType) entity.DetailedAssessmentResultForFactorizedLowerLimitNorm; + sectionResult.TailorMadeAssessmentResult = (TailorMadeAssessmentCategoryGroupResultType) entity.TailorMadeAssessmentResult; + sectionResult.UseManualAssembly = Convert.ToBoolean(entity.UseManualAssembly); + sectionResult.ManualAssemblyCategoryGroup = (FailureMechanismSectionAssemblyCategoryGroup) entity.ManualAssemblyCategoryGroup; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsCalculationEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsCalculationEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsCalculationEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,118 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Linq; +using Core.Common.Base.Data; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Revetment.Data; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.WaveImpactAsphaltCover.Data; + +namespace Ringtoets.Storage.Core.Read.WaveImpactAsphaltCover +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class WaveImpactAsphaltCoverWaveConditionsCalculationEntityReadExtensions + { + /// + /// Reads the and use the + /// information to update a . + /// + /// The + /// to create for. + /// The object keeping track of read operations. + /// A new . + /// Thrown when any parameter is null. + internal static WaveImpactAsphaltCoverWaveConditionsCalculation Read(this WaveImpactAsphaltCoverWaveConditionsCalculationEntity entity, + ReadConversionCollector collector) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (collector == null) + { + throw new ArgumentNullException(nameof(collector)); + } + + var calculation = new WaveImpactAsphaltCoverWaveConditionsCalculation + { + Name = entity.Name, + Comments = + { + Body = entity.Comments + } + }; + ReadInputParameters(calculation.InputParameters, entity, collector); + ReadOutput(calculation, entity); + + return calculation; + } + + private static void ReadInputParameters(AssessmentSectionCategoryWaveConditionsInput inputParameters, + WaveImpactAsphaltCoverWaveConditionsCalculationEntity entity, + ReadConversionCollector collector) + { + inputParameters.ForeshoreProfile = GetDikeProfileValue(entity.ForeshoreProfileEntity, collector); + inputParameters.HydraulicBoundaryLocation = GetHydraulicBoundaryLocationValue(entity.HydraulicLocationEntity, collector); + inputParameters.Orientation = (RoundedDouble) entity.Orientation.ToNullAsNaN(); + inputParameters.UseForeshore = Convert.ToBoolean(entity.UseForeshore); + inputParameters.UseBreakWater = Convert.ToBoolean(entity.UseBreakWater); + inputParameters.BreakWater.Height = (RoundedDouble) entity.BreakWaterHeight.ToNullAsNaN(); + inputParameters.BreakWater.Type = (BreakWaterType) entity.BreakWaterType; + inputParameters.UpperBoundaryRevetment = (RoundedDouble) entity.UpperBoundaryRevetment.ToNullAsNaN(); + inputParameters.LowerBoundaryRevetment = (RoundedDouble) entity.LowerBoundaryRevetment.ToNullAsNaN(); + inputParameters.UpperBoundaryWaterLevels = (RoundedDouble) entity.UpperBoundaryWaterLevels.ToNullAsNaN(); + inputParameters.LowerBoundaryWaterLevels = (RoundedDouble) entity.LowerBoundaryWaterLevels.ToNullAsNaN(); + inputParameters.StepSize = (WaveConditionsInputStepSize) entity.StepSize; + inputParameters.CategoryType = (AssessmentSectionCategoryType) entity.CategoryType; + } + + private static ForeshoreProfile GetDikeProfileValue(ForeshoreProfileEntity foreshoreProfileEntity, ReadConversionCollector collector) + { + return foreshoreProfileEntity?.Read(collector); + } + + private static HydraulicBoundaryLocation GetHydraulicBoundaryLocationValue( + HydraulicLocationEntity hydraulicLocationEntity, + ReadConversionCollector collector) + { + return hydraulicLocationEntity?.Read(collector); + } + + private static void ReadOutput(WaveImpactAsphaltCoverWaveConditionsCalculation calculation, WaveImpactAsphaltCoverWaveConditionsCalculationEntity entity) + { + if (entity.WaveImpactAsphaltCoverWaveConditionsOutputEntities.Any()) + { + calculation.Output = new WaveImpactAsphaltCoverWaveConditionsOutput(entity.WaveImpactAsphaltCoverWaveConditionsOutputEntities + .OrderBy(oe => oe.Order) + .Select(oe => oe.Read()) + .ToArray()); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Read/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsOutputEntityReadExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Read/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsOutputEntityReadExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Read/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsOutputEntityReadExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,56 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Revetment.Data; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.WaveImpactAsphaltCover.Data; + +namespace Ringtoets.Storage.Core.Read.WaveImpactAsphaltCover +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class WaveImpactAsphaltCoverWaveConditionsOutputEntityReadExtensions + { + /// + /// Reads the + /// and use the information to construct a . + /// + /// The + /// to create for. + /// A new . + internal static WaveConditionsOutput Read(this WaveImpactAsphaltCoverWaveConditionsOutputEntity entity) + { + return new WaveConditionsOutput(entity.WaterLevel.ToNullAsNaN(), + entity.WaveHeight.ToNullAsNaN(), + entity.WavePeakPeriod.ToNullAsNaN(), + entity.WaveAngle.ToNullAsNaN(), + entity.WaveDirection.ToNullAsNaN(), + entity.TargetProbability.ToNullAsNaN(), + entity.TargetReliability.ToNullAsNaN(), + entity.CalculatedProbability.ToNullAsNaN(), + entity.CalculatedReliability.ToNullAsNaN(), + (CalculationConvergence) entity.CalculationConvergence); + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Ringtoets.rtd =================================================================== diff -u Binary files differ Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Riskeer.Storage.Core.csproj =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Riskeer.Storage.Core.csproj (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Riskeer.Storage.Core.csproj (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,712 @@ + + + + {50963F12-448C-41BA-A62C-CDB0AB8D21E0} + Riskeer.Storage.Core + Riskeer.Storage.Core + + + + + ..\..\..\..\packages\EntityFramework.6.1.3\lib\net40\EntityFramework.dll + True + + + ..\..\..\..\packages\log4net.2.0.4\lib\net40-full\log4net.dll + True + + + + + + ..\..\..\..\packages\System.Data.SQLite.Core.1.0.106.0\lib\net40\System.Data.SQLite.dll + True + + + ..\..\..\..\packages\System.Data.SQLite.EF6.1.0.106.0\lib\net40\System.Data.SQLite.EF6.dll + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + + + + + + + + + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + True + True + RiskeerEntities.Context.tt + + + True + True + RiskeerEntities.tt + + + True + True + RiskeerEntities.edmx + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + RiskeerEntities.tt + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + Resources.resx + + + + + + + + {3bbfd65b-b277-4e50-ae6d-bd24c3434609} + Core.Common.Base + False + + + {E344867E-9AC9-44C8-88A5-8185681679A9} + Core.Common.IO + False + + + {F49BD8B2-332A-4C91-A196-8CCE0A2C7D98} + Core.Common.Util + False + + + {420ed9c3-0c33-47ea-b893-121a9c0db4f1} + Ringtoets.AssemblyTool.Data + False + + + {c6309704-d67b-434c-bc98-9f8910bc1d10} + Ringtoets.ClosingStructures.Data + False + + + {78aa56f5-431d-465c-ac50-3173d7e90ac1} + Ringtoets.Common.Primitives + False + + + {6A074D65-A81C-4C1C-8E24-F36C916E4ED7} + Ringtoets.Common.Util + False + + + {d1068432-c172-4aa6-847b-d9deb4c6de26} + Ringtoets.DuneErosion.Data + False + + + {83d6b73e-91d5-46b0-9218-955da1f75f7c} + Ringtoets.MacroStabilityInwards.Data + False + + + {e9b39743-2dc9-4922-9e0f-6ba3e0e54189} + Ringtoets.MacroStabilityInwards.Primitives + False + + + {87c2c553-c0bc-40bf-b1ea-b83bff357f27} + Ringtoets.Revetment.Data + False + + + {3d4b9740-8348-4434-8d77-b611fc6ee57f} + Ringtoets.StabilityPointStructures.Data + False + + + {567E0B69-5280-41CE-ADD6-443725A61C86} + Ringtoets.WaveImpactAsphaltCover.Data + False + + + {d4200f43-3f72-4f42-af0a-8ced416a38ec} + Ringtoets.Common.Data + False + + + {90DE728E-48EF-4665-AB38-3D88E41D9F4D} + Ringtoets.GrassCoverErosionInwards.Data + False + + + {e7225477-577f-4a17-b7ec-6721158e1543} + Ringtoets.GrassCoverErosionOutwards.Data + False + + + {1c0017d8-35b5-4ca0-8fc7-a83f46dbdc99} + Ringtoets.HeightStructures.Data + False + + + {11F1F874-45AF-43E4-8AE5-15A5C9593E28} + Ringtoets.Integration.Data + False + + + {CE994CC9-6F6A-48AC-B4BE-02C30A21F4DB} + Ringtoets.Piping.Data + False + + + {14c6f716-64e2-4bc4-a1ef-05865fcefa4c} + Ringtoets.Piping.Primitives + False + + + {b479e3af-7c34-488c-bb73-d324100d36c9} + Ringtoets.StabilityStoneCover.Data + False + + + + + Copying.licenseheader + + + DbContext\DatabaseStructure + + + Designer + + + + EntityModelCodeGenerator + RiskeerEntities.Designer.cs + + + RiskeerEntities.edmx + + + + + PublicResXFileCodeGenerator + Resources.Designer.cs + Designer + + + + + + + + TextTemplatingFileGenerator + RiskeerEntities.Context.cs + RiskeerEntities.edmx + + + TextTemplatingFileGenerator + RiskeerEntities.cs + RiskeerEntities.edmx + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/RoundedDoubleConversionExtensions.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/RoundedDoubleConversionExtensions.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/RoundedDoubleConversionExtensions.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,50 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; + +namespace Ringtoets.Storage.Core +{ + /// + /// Class that contains extension methods for to convert them to + /// other value types. + /// + public static class RoundedDoubleConversionExtensions + { + /// + /// Converts a to a . If + /// is , the result is null. + /// + /// The value to convert. + /// null if is , + /// the value of otherwise. + public static RoundedDouble? ToNaNAsNull(this RoundedDouble value) + { + if (double.IsNaN(value)) + { + return null; + } + + return value; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Serializers/DataCollectionSerializer.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Serializers/DataCollectionSerializer.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Serializers/DataCollectionSerializer.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,118 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Xml; + +namespace Ringtoets.Storage.Core.Serializers +{ + /// + /// Converter class that converts between a collection of and + /// an XML representation of that data. + /// + internal abstract class DataCollectionSerializer + where TSerializedData : class + { + private static readonly Type serializationRootType = typeof(TSerializedData[]); + private readonly Encoding encoding = Encoding.UTF8; + + /// + /// Converts the collection of to XML data. + /// + /// The elements to be serialized. + /// The XML data. + /// Thrown when is null. + /// Thrown when an I/O error occurs. + /// Thrown when does not conform to data contract rules. + /// E.g., the has not been applied to the . + /// Thrown when an error occurs during serialization. + public string ToXml(IEnumerable elements) + { + if (elements == null) + { + throw new ArgumentNullException(nameof(elements)); + } + + var memoryStream = new MemoryStream(); + + using (XmlDictionaryWriter writer = XmlDictionaryWriter.CreateTextWriter(memoryStream, encoding, false)) + { + var formatter = new DataContractSerializer(serializationRootType); + formatter.WriteObject(writer, ToSerializableData(elements)); + writer.Flush(); + } + + using (var streamReader = new StreamReader(memoryStream)) + { + memoryStream.Seek(0, SeekOrigin.Begin); + return streamReader.ReadToEnd(); + } + } + + /// + /// Converts XML to an array of. + /// + /// The XML. + /// An array of . + /// Thrown when is null or empty. + /// Thrown when an I/O error occurs. + /// Thrown when an error occurs during deserialization. + public TData[] FromXml(string xml) + { + if (string.IsNullOrEmpty(xml)) + { + throw new ArgumentException(@"xml cannot be empty.", nameof(xml)); + } + + var stream = new MemoryStream(); + using (var streamWriter = new StreamWriter(stream, encoding)) + { + streamWriter.Write(xml); + streamWriter.Flush(); + + stream.Seek(0, SeekOrigin.Begin); + using (XmlDictionaryReader reader = XmlDictionaryReader.CreateTextReader(stream, XmlDictionaryReaderQuotas.Max)) + { + var serializer = new DataContractSerializer(serializationRootType); + return FromSerializableData((TSerializedData[]) serializer.ReadObject(reader)); + } + } + } + + /// + /// Converts to the serializable representation. + /// + /// The elements to convert. + /// The serialized elements. + protected abstract TSerializedData[] ToSerializableData(IEnumerable elements); + + /// + /// Converts the to . + /// + /// The serialized data to convert. + /// The deserialized elements + protected abstract TData[] FromSerializableData(IEnumerable serializedElements); + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Serializers/MacroStabilityInwardsSliceCollectionXmlSerializer.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Serializers/MacroStabilityInwardsSliceCollectionXmlSerializer.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Serializers/MacroStabilityInwardsSliceCollectionXmlSerializer.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,274 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using Core.Common.Base.Geometry; +using Ringtoets.MacroStabilityInwards.Data; + +namespace Ringtoets.Storage.Core.Serializers +{ + /// + /// Converter class that converts between a collection of + /// and an XML representation of that data. + /// + internal class MacroStabilityInwardsSliceCollectionXmlSerializer : DataCollectionSerializer + { + protected override SerializableMacroStabilityInwardsSlice[] ToSerializableData(IEnumerable elements) + { + return elements.Select(s => new SerializableMacroStabilityInwardsSlice(s)).ToArray(); + } + + protected override MacroStabilityInwardsSlice[] FromSerializableData(IEnumerable serializedElements) + { + return serializedElements.Select(se => se.ToMacroStabilityInwardsSlice()).ToArray(); + } + + [Serializable] + [DataContract(Name = nameof(SerializableMacroStabilityInwardsSlice), Namespace = "")] + internal class SerializableMacroStabilityInwardsSlice + { + /// + /// Creates a new instance of . + /// + /// The to base the + /// on. + public SerializableMacroStabilityInwardsSlice(MacroStabilityInwardsSlice slice) + { + topLeftPointX = slice.TopLeftPoint.X; + topLeftPointY = slice.TopLeftPoint.Y; + topRightPointX = slice.TopRightPoint.X; + topRightPointY = slice.TopRightPoint.Y; + + bottomLeftPointX = slice.BottomLeftPoint.X; + bottomLeftPointY = slice.BottomLeftPoint.Y; + bottomRightPointX = slice.BottomRightPoint.X; + bottomRightPointY = slice.BottomRightPoint.Y; + + cohesion = slice.Cohesion; + frictionAngle = slice.FrictionAngle; + criticalPressure = slice.CriticalPressure; + overConsolidationRatio = slice.OverConsolidationRatio; + pop = slice.Pop; + degreeOfConsolidationPorePressureSoil = slice.DegreeOfConsolidationPorePressureSoil; + degreeOfConsolidationPorePressureLoad = slice.DegreeOfConsolidationPorePressureLoad; + dilatancy = slice.Dilatancy; + externalLoad = slice.ExternalLoad; + hydrostaticPorePressure = slice.HydrostaticPorePressure; + leftForce = slice.LeftForce; + leftForceAngle = slice.LeftForceAngle; + leftForceY = slice.LeftForceY; + rightForce = slice.RightForce; + rightForceAngle = slice.RightForceAngle; + rightForceY = slice.RightForceY; + loadStress = slice.LoadStress; + normalStress = slice.NormalStress; + porePressure = slice.PorePressure; + horizontalPorePressure = slice.HorizontalPorePressure; + verticalPorePressure = slice.VerticalPorePressure; + piezometricPorePressure = slice.PiezometricPorePressure; + effectiveStress = slice.EffectiveStress; + effectiveStressDaily = slice.EffectiveStressDaily; + excessPorePressure = slice.ExcessPorePressure; + shearStress = slice.ShearStress; + soilStress = slice.SoilStress; + totalPorePressure = slice.TotalPorePressure; + totalStress = slice.TotalStress; + weight = slice.Weight; + } + + /// + /// Creates a new instance of . + /// + /// The new instance of . + public MacroStabilityInwardsSlice ToMacroStabilityInwardsSlice() + { + return new MacroStabilityInwardsSlice( + new Point2D(topLeftPointX, topLeftPointY), + new Point2D(topRightPointX, topRightPointY), + new Point2D(bottomLeftPointX, bottomLeftPointY), + new Point2D(bottomRightPointX, bottomRightPointY), + new MacroStabilityInwardsSlice.ConstructionProperties + { + Cohesion = cohesion, + FrictionAngle = frictionAngle, + CriticalPressure = criticalPressure, + OverConsolidationRatio = overConsolidationRatio, + Pop = pop, + DegreeOfConsolidationPorePressureSoil = degreeOfConsolidationPorePressureSoil, + DegreeOfConsolidationPorePressureLoad = degreeOfConsolidationPorePressureLoad, + Dilatancy = dilatancy, + ExternalLoad = externalLoad, + HydrostaticPorePressure = hydrostaticPorePressure, + LeftForce = leftForce, + LeftForceAngle = leftForceAngle, + LeftForceY = leftForceY, + RightForce = rightForce, + RightForceAngle = rightForceAngle, + RightForceY = rightForceY, + LoadStress = loadStress, + NormalStress = normalStress, + PorePressure = porePressure, + HorizontalPorePressure = horizontalPorePressure, + VerticalPorePressure = verticalPorePressure, + PiezometricPorePressure = piezometricPorePressure, + EffectiveStress = effectiveStress, + EffectiveStressDaily = effectiveStressDaily, + ExcessPorePressure = excessPorePressure, + ShearStress = shearStress, + SoilStress = soilStress, + TotalPorePressure = totalPorePressure, + TotalStress = totalStress, + Weight = weight + }); + } + + #region Top coordinates + + [DataMember] + private readonly double topLeftPointX; + + [DataMember] + private readonly double topLeftPointY; + + [DataMember] + private readonly double topRightPointX; + + [DataMember] + private readonly double topRightPointY; + + #endregion + + #region Bottom coordinates + + [DataMember] + private readonly double bottomLeftPointX; + + [DataMember] + private readonly double bottomLeftPointY; + + [DataMember] + private readonly double bottomRightPointX; + + [DataMember] + private readonly double bottomRightPointY; + + #endregion + + #region Data + + [DataMember] + private readonly double cohesion; + + [DataMember] + private readonly double frictionAngle; + + [DataMember] + private readonly double criticalPressure; + + [DataMember] + private readonly double overConsolidationRatio; + + [DataMember] + private readonly double pop; + + [DataMember] + private readonly double degreeOfConsolidationPorePressureSoil; + + [DataMember] + private readonly double degreeOfConsolidationPorePressureLoad; + + [DataMember] + private readonly double dilatancy; + + [DataMember] + private readonly double externalLoad; + + [DataMember] + private readonly double hydrostaticPorePressure; + + [DataMember] + private readonly double leftForce; + + [DataMember] + private readonly double leftForceAngle; + + [DataMember] + private readonly double leftForceY; + + [DataMember] + private readonly double rightForce; + + [DataMember] + private readonly double rightForceAngle; + + [DataMember] + private readonly double rightForceY; + + [DataMember] + private readonly double loadStress; + + [DataMember] + private readonly double normalStress; + + [DataMember] + private readonly double porePressure; + + [DataMember] + private readonly double horizontalPorePressure; + + [DataMember] + private readonly double verticalPorePressure; + + [DataMember] + private readonly double piezometricPorePressure; + + [DataMember] + private readonly double effectiveStress; + + [DataMember] + private readonly double effectiveStressDaily; + + [DataMember] + private readonly double excessPorePressure; + + [DataMember] + private readonly double shearStress; + + [DataMember] + private readonly double soilStress; + + [DataMember] + private readonly double totalPorePressure; + + [DataMember] + private readonly double totalStress; + + [DataMember] + private readonly double weight; + + #endregion + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Serializers/Point2DCollectionXmlSerializer.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Serializers/Point2DCollectionXmlSerializer.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Serializers/Point2DCollectionXmlSerializer.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,68 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using Core.Common.Base.Geometry; + +namespace Ringtoets.Storage.Core.Serializers +{ + /// + /// Converter class that converts between a collection of and an + /// XML representation of that data. + /// + internal class Point2DCollectionXmlSerializer : DataCollectionSerializer + { + protected override SerializablePoint2D[] ToSerializableData(IEnumerable points) + { + return points.Select(p => new SerializablePoint2D(p)).ToArray(); + } + + protected override Point2D[] FromSerializableData(IEnumerable pointData) + { + return pointData.Select(pd => pd.ToPoint2D()).ToArray(); + } + + [Serializable] + [DataContract(Name = nameof(SerializablePoint2D), Namespace = "")] + internal class SerializablePoint2D + { + [DataMember] + private readonly double x; + + [DataMember] + private readonly double y; + + public SerializablePoint2D(Point2D point2D) + { + x = point2D.X; + y = point2D.Y; + } + + public Point2D ToPoint2D() + { + return new Point2D(x, y); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Serializers/Point3DCollectionXmlSerializer.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Serializers/Point3DCollectionXmlSerializer.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Serializers/Point3DCollectionXmlSerializer.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,72 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using Core.Common.Base.Geometry; + +namespace Ringtoets.Storage.Core.Serializers +{ + /// + /// Converter class that converts between a collection of and an + /// XML representation of that data. + /// + internal class Point3DCollectionXmlSerializer : DataCollectionSerializer + { + protected override Point3D[] FromSerializableData(IEnumerable serializedElements) + { + return serializedElements.Select(sp => sp.ToPoint3D()).ToArray(); + } + + protected override SerializablePoint3D[] ToSerializableData(IEnumerable elements) + { + return elements.Select(p => new SerializablePoint3D(p)).ToArray(); + } + + [Serializable] + [DataContract(Name = nameof(SerializablePoint3D), Namespace = "")] + internal class SerializablePoint3D + { + [DataMember] + private readonly double x; + + [DataMember] + private readonly double y; + + [DataMember] + private readonly double z; + + public SerializablePoint3D(Point3D point3D) + { + x = point3D.X; + y = point3D.Y; + z = point3D.Z; + } + + public Point3D ToPoint3D() + { + return new Point3D(x, y, z); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Serializers/RoughnessPointCollectionXmlSerializer.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Serializers/RoughnessPointCollectionXmlSerializer.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Serializers/RoughnessPointCollectionXmlSerializer.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,73 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using Core.Common.Base.Geometry; +using Ringtoets.Common.Data.DikeProfiles; + +namespace Ringtoets.Storage.Core.Serializers +{ + /// + /// Converter class that converts between a collection of + /// and an XML representation of that data. + /// + internal class RoughnessPointCollectionXmlSerializer : DataCollectionSerializer + { + protected override SerializableRoughnessPoint[] ToSerializableData(IEnumerable elements) + { + return elements.Select(p => new SerializableRoughnessPoint(p)).ToArray(); + } + + protected override RoughnessPoint[] FromSerializableData(IEnumerable serializedElements) + { + return serializedElements.Select(sp => sp.ToRoughnessPoint()).ToArray(); + } + + [Serializable] + [DataContract(Name = nameof(SerializableRoughnessPoint), Namespace = "")] + internal class SerializableRoughnessPoint + { + [DataMember] + private readonly double x; + + [DataMember] + private readonly double y; + + [DataMember] + private readonly double roughness; + + public SerializableRoughnessPoint(RoughnessPoint point) + { + x = point.Point.X; + y = point.Point.Y; + roughness = point.Roughness; + } + + public RoughnessPoint ToRoughnessPoint() + { + return new RoughnessPoint(new Point2D(x, y), roughness); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/Serializers/TangentLineCollectionXmlSerializer.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/Serializers/TangentLineCollectionXmlSerializer.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/Serializers/TangentLineCollectionXmlSerializer.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,68 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using Core.Common.Base.Data; + +namespace Ringtoets.Storage.Core.Serializers +{ + /// + /// Converter class that converts between collections of tangent lines and an XML representation of that data. + /// + internal class TangentLineCollectionXmlSerializer : DataCollectionSerializer + { + protected override SerializableTangentLine[] ToSerializableData(IEnumerable elements) + { + return elements.Select(e => new SerializableTangentLine(e)).ToArray(); + } + + protected override RoundedDouble[] FromSerializableData(IEnumerable serializedElements) + { + return serializedElements.Select(se => se.ToTangentLine()).ToArray(); + } + + [Serializable] + [DataContract(Name = nameof(SerializableTangentLine), Namespace = "")] + internal class SerializableTangentLine + { + [DataMember] + private readonly double tangentLine; + + /// + /// Creates a new instance of . + /// + /// The to base the + /// on. + public SerializableTangentLine(double tangentLine) + { + this.tangentLine = tangentLine; + } + + public RoundedDouble ToTangentLine() + { + return (RoundedDouble) tangentLine; + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/SqLiteEntityConnectionStringBuilder.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/SqLiteEntityConnectionStringBuilder.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/SqLiteEntityConnectionStringBuilder.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,59 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Data.Entity.Core.EntityClient; +using Core.Common.IO; + +namespace Ringtoets.Storage.Core +{ + /// + /// This class builds a connection string to a SQLite database file. + /// + public static class SqLiteEntityConnectionStringBuilder + { + /// + /// Constructs a connection string to connect the Entity Framework to . + /// + /// Location of the storage file. + /// A new connection string. + /// Thrown when is null or empty (only whitespaces). + public static string BuildSqLiteEntityConnectionString(string filePath) + { + if (string.IsNullOrWhiteSpace(filePath)) + { + throw new ArgumentNullException(nameof(filePath), @"Cannot create a connection string without the path to the file to connect to."); + } + + return new EntityConnectionStringBuilder + { + Metadata = string.Format(@"res://*/{0}.csdl|res://*/{0}.ssdl|res://*/{0}.msl", "DbContext.RiskeerEntities"), + Provider = @"System.Data.SQLite.EF6", + ProviderConnectionString = SqLiteConnectionStringBuilder.BuildSqLiteConnectionString(GetDataSourceLocation(filePath), false) + }.ConnectionString; + } + + private static string GetDataSourceLocation(string filePath) + { + return new Uri(filePath).IsUnc ? "\\\\" + filePath : filePath; + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/StorageSqLite.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/StorageSqLite.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/StorageSqLite.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,366 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Data; +using System.Data.Entity; +using System.IO; +using System.Linq; +using System.ServiceModel; +using Core.Common.Base.Data; +using Core.Common.Base.Storage; +using Core.Common.Util; +using Core.Common.Util.Builders; +using log4net; +using Ringtoets.Common.Util; +using Ringtoets.Integration.Data; +using Ringtoets.Storage.Core.Create; +using Ringtoets.Storage.Core.DbContext; +using Ringtoets.Storage.Core.Exceptions; +using Ringtoets.Storage.Core.Properties; +using Ringtoets.Storage.Core.Read; +using UtilResources = Core.Common.Util.Properties.Resources; + +namespace Ringtoets.Storage.Core +{ + /// + /// This class interacts with an SQLite database file using the Entity Framework. + /// + public class StorageSqLite : IStoreProject + { + private static readonly ILog log = LogManager.GetLogger(typeof(StorageSqLite)); + + private StagedProject stagedProject; + + public string FileFilter + { + get + { + return Resources.Ringtoets_project_file_filter; + } + } + + public bool HasStagedProject + { + get + { + return stagedProject != null; + } + } + + public void StageProject(IProject project) + { + var ringtoetsProject = project as RingtoetsProject; + if (ringtoetsProject == null) + { + throw new ArgumentNullException(nameof(project)); + } + + var registry = new PersistenceRegistry(); + + stagedProject = new StagedProject(ringtoetsProject, ringtoetsProject.Create(registry)); + } + + public void UnstageProject() + { + stagedProject = null; + } + + public void SaveProjectAs(string databaseFilePath) + { + if (!HasStagedProject) + { + throw new InvalidOperationException("Call 'StageProject(IProject)' first before calling this method."); + } + + try + { + var writer = new BackedUpFileWriter(databaseFilePath); + writer.Perform(() => SaveProjectInDatabase(databaseFilePath)); + } + catch (IOException e) + { + throw new StorageException(e.Message, e); + } + catch (CannotDeleteBackupFileException e) + { + log.Warn(e.Message, e); + } + finally + { + UnstageProject(); + } + } + + public IProject LoadProject(string databaseFilePath) + { + string connectionString = GetConnectionToExistingFile(databaseFilePath); + try + { + RingtoetsProject project; + using (var dbContext = new RiskeerEntities(connectionString)) + { + ValidateDatabaseVersion(dbContext, databaseFilePath); + + dbContext.LoadTablesIntoContext(); + + ProjectEntity projectEntity; + try + { + projectEntity = dbContext.ProjectEntities.Local.Single(); + } + catch (InvalidOperationException exception) + { + throw CreateStorageReaderException(databaseFilePath, Resources.StorageSqLite_LoadProject_Invalid_Ringtoets_database_file, exception); + } + + project = projectEntity.Read(new ReadConversionCollector()); + } + + project.Name = Path.GetFileNameWithoutExtension(databaseFilePath); + return project; + } + catch (DataException exception) + { + throw CreateStorageReaderException(databaseFilePath, Resources.StorageSqLite_LoadProject_Invalid_Ringtoets_database_file, exception); + } + catch (SystemException exception) + { + throw CreateStorageReaderException(databaseFilePath, Resources.StorageSqLite_LoadProject_Invalid_Ringtoets_database_file, exception); + } + } + + public bool HasStagedProjectChanges(string filePath) + { + if (!HasStagedProject) + { + throw new InvalidOperationException("Call 'StageProject(IProject)' first before calling this method."); + } + + if (string.IsNullOrWhiteSpace(filePath)) + { + return true; + } + + string connectionString = GetConnectionToExistingFile(filePath); + try + { + byte[] originalHash; + using (var dbContext = new RiskeerEntities(connectionString)) + originalHash = dbContext.VersionEntities.Select(v => v.FingerPrint).First(); + + byte[] hash = FingerprintHelper.Get(stagedProject.Entity); + return !FingerprintHelper.AreEqual(originalHash, hash); + } + catch (CannotDetermineFingerprintException e) + { + if (e.InnerException is QuotaExceededException) + { + throw new StorageException(Resources.StorageSqLite_HasStagedProjectChanges_Project_contains_too_many_objects_to_generate_fingerprint, e); + } + + throw new StorageException(e.Message, e); + } + } + + private void SaveProjectInDatabase(string databaseFilePath) + { + string connectionString = GetConnectionToNewFile(databaseFilePath); + using (var dbContext = new RiskeerEntities(connectionString)) + { + try + { + dbContext.VersionEntities.Add(new VersionEntity + { + Version = RingtoetsVersionHelper.GetCurrentDatabaseVersion(), + Timestamp = DateTime.Now, + FingerPrint = FingerprintHelper.Get(stagedProject.Entity) + }); + dbContext.ProjectEntities.Add(stagedProject.Entity); + dbContext.SaveChanges(); + } + catch (DataException exception) + { + throw CreateStorageWriterException(databaseFilePath, Resources.Error_saving_database, exception); + } + catch (CannotDetermineFingerprintException exception) + { + throw CreateStorageWriterException(databaseFilePath, exception.Message, exception); + } + catch (SystemException exception) + { + if (exception is InvalidOperationException || exception is NotSupportedException) + { + throw CreateStorageWriterException(databaseFilePath, Resources.Error_during_connection, exception); + } + + throw; + } + + stagedProject.Model.Name = Path.GetFileNameWithoutExtension(databaseFilePath); + } + } + + private static void ValidateDatabaseVersion(RiskeerEntities riskeerEntities, string databaseFilePath) + { + try + { + string databaseVersion = riskeerEntities.VersionEntities.Select(v => v.Version).Single(); + if (!RingtoetsVersionHelper.IsValidVersion(databaseVersion)) + { + string m = string.Format(Resources.StorageSqLite_ValidateDatabaseVersion_DatabaseVersion_0_is_invalid, + databaseVersion); + string message = new FileReaderErrorMessageBuilder(databaseFilePath).Build(m); + throw new StorageValidationException(message); + } + + if (RingtoetsVersionHelper.IsNewerThanCurrent(databaseVersion)) + { + string m = string.Format(Resources.StorageSqLite_ValidateDatabaseVersion_DatabaseVersion_0_higher_then_current_DatabaseVersion_1_, + databaseVersion, RingtoetsVersionHelper.GetCurrentDatabaseVersion()); + string message = new FileReaderErrorMessageBuilder(databaseFilePath).Build(m); + throw new StorageValidationException(message); + } + } + catch (InvalidOperationException e) + { + string message = new FileReaderErrorMessageBuilder(databaseFilePath).Build(Resources.StorageSqLite_ValidateDatabaseVersion_Database_must_have_one_VersionEntity_row); + throw new StorageValidationException(message, e); + } + } + + /// + /// Attempts to set the connection to an existing storage file . + /// + /// Path to database file. + /// is invalid. + /// Thrown when: + /// does not exist + /// the database has an invalid schema. + /// + /// + private static string GetConnectionToExistingFile(string databaseFilePath) + { + IOUtils.ValidateFilePath(databaseFilePath); + return GetConnectionToFile(databaseFilePath); + } + + /// + /// Sets the connection to a newly created (empty) Ringtoets database file. + /// + /// Path to database file. + /// Thrown when: + /// + /// is invalid + /// points to an existing file + /// + /// Thrown when: + /// executing DatabaseStructure script failed + /// + /// + private static string GetConnectionToNewFile(string databaseFilePath) + { + IOUtils.ValidateFilePath(databaseFilePath); + StorageSqliteCreator.CreateDatabaseStructure(databaseFilePath); + return GetConnectionToFile(databaseFilePath); + } + + /// + /// Establishes a connection to an existing . + /// + /// The path of the database file to connect to. + /// No file exists at . + private static string GetConnectionToFile(string databaseFilePath) + { + if (!File.Exists(databaseFilePath)) + { + string message = new FileReaderErrorMessageBuilder(databaseFilePath).Build(UtilResources.Error_File_does_not_exist); + throw new CouldNotConnectException(message); + } + + return GetConnectionToStorage(databaseFilePath); + } + + /// + /// Sets the connection to the Ringtoets database. + /// + /// The path of the file, which is used for creating exceptions. + /// Thrown when the database does not contain the table version. + private static string GetConnectionToStorage(string databaseFilePath) + { + string connectionString = SqLiteEntityConnectionStringBuilder.BuildSqLiteEntityConnectionString(databaseFilePath); + + using (var dbContext = new RiskeerEntities(connectionString)) + { + try + { + dbContext.Database.Initialize(true); + dbContext.VersionEntities.Load(); + } + catch (Exception exception) + { + string message = new FileReaderErrorMessageBuilder(databaseFilePath).Build(Resources.StorageSqLite_LoadProject_Invalid_Ringtoets_database_file); + throw new StorageValidationException(message, exception); + } + } + + return connectionString; + } + + /// + /// Creates a configured instance of when writing to the storage file failed. + /// + /// The path of the file that was attempted to connect with. + /// The critical error message. + /// Exception that caused this exception to be thrown. + /// Returns a new . + private static StorageException CreateStorageWriterException(string databaseFilePath, string errorMessage, Exception innerException) + { + string message = new FileWriterErrorMessageBuilder(databaseFilePath).Build(errorMessage); + return new StorageException(message, innerException); + } + + /// + /// Creates a configured instance of when reading the storage file failed. + /// + /// The path of the file that was attempted to connect with. + /// The critical error message. + /// Exception that caused this exception to be thrown. + /// Returns a new . + private static StorageException CreateStorageReaderException(string databaseFilePath, string errorMessage, Exception innerException = null) + { + string message = new FileReaderErrorMessageBuilder(databaseFilePath).Build(errorMessage); + return new StorageException(message, innerException); + } + + private class StagedProject + { + public StagedProject(RingtoetsProject projectModel, ProjectEntity projectEntity) + { + Model = projectModel; + Entity = projectEntity; + } + + public RingtoetsProject Model { get; } + public ProjectEntity Entity { get; } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/StorageSqliteCreator.cs =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/StorageSqliteCreator.cs (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/StorageSqliteCreator.cs (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,84 @@ +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Data.SQLite; +using System.IO; +using Core.Common.Base.Storage; +using Core.Common.IO; +using Core.Common.Util; +using Core.Common.Util.Builders; +using Ringtoets.Storage.Core.Properties; + +namespace Ringtoets.Storage.Core +{ + /// + /// This class interacts with an empty or new SQLite database file. + /// + public static class StorageSqliteCreator + { + /// + /// Creates a new file with the basic database structure for a Ringtoets database at + /// . + /// + /// Path of the new database file. + /// Thrown when either: + /// + /// is invalid + /// points to an existing file + /// + /// Thrown when executing DatabaseStructure script fails. + public static void CreateDatabaseStructure(string databaseFilePath) + { + IOUtils.ValidateFilePath(databaseFilePath); + + if (File.Exists(databaseFilePath)) + { + string message = $"File '{databaseFilePath}' already exists."; + throw new ArgumentException(message); + } + + SQLiteConnection.CreateFile(databaseFilePath); + string connectionString = SqLiteConnectionStringBuilder.BuildSqLiteConnectionString(databaseFilePath, false); + try + { + using (var dbContext = new SQLiteConnection(connectionString, true)) + { + dbContext.Open(); + using (SQLiteCommand command = dbContext.CreateCommand()) + { + command.CommandText = Resources.DatabaseStructure; + command.ExecuteNonQuery(); + } + } + } + catch (SQLiteException exception) + { + string message = new FileWriterErrorMessageBuilder(databaseFilePath).Build(Resources.Error_writing_structure_to_database); + throw new StorageException(message, new UpdateStorageException("", exception)); + } + finally + { + SQLiteConnection.ClearAllPools(); + } + } + } +} \ No newline at end of file Index: Ringtoets/Storage/src/Riskeer.Storage.Core/packages.config =================================================================== diff -u --- Ringtoets/Storage/src/Riskeer.Storage.Core/packages.config (revision 0) +++ Ringtoets/Storage/src/Riskeer.Storage.Core/packages.config (revision 5f61c64020ac01999b88a49cc70eafba7134e450) @@ -0,0 +1,28 @@ + + + + + + + \ No newline at end of file