Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/AssessmentSectionCreateExtensions.cs =================================================================== diff -u -r508d720230c5f63bce7f95bddc3b7a04808d267d -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/AssessmentSectionCreateExtensions.cs (.../AssessmentSectionCreateExtensions.cs) (revision 508d720230c5f63bce7f95bddc3b7a04808d267d) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/AssessmentSectionCreateExtensions.cs (.../AssessmentSectionCreateExtensions.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -114,9 +114,10 @@ entity.HydraulicDatabaseLocation = section.HydraulicBoundaryDatabase.FilePath; entity.HydraulicDatabaseVersion = section.HydraulicBoundaryDatabase.Version; - foreach (var hydraulicBoundaryLocation in section.HydraulicBoundaryDatabase.Locations) + for (int i = 0; i < section.HydraulicBoundaryDatabase.Locations.Count; i++) { - entity.HydraulicLocationEntities.Add(hydraulicBoundaryLocation.Create(registry)); + var hydraulicBoundaryLocation = section.HydraulicBoundaryDatabase.Locations[i]; + entity.HydraulicLocationEntities.Add(hydraulicBoundaryLocation.Create(registry, i)); } } } Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/GrassCoverErosionInwards/DikeProfileCreateExtensions.cs =================================================================== diff -u -rbc7cd9cbf90d04580e6b3542c56edc590867c43a -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/GrassCoverErosionInwards/DikeProfileCreateExtensions.cs (.../DikeProfileCreateExtensions.cs) (revision bc7cd9cbf90d04580e6b3542c56edc590867c43a) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/GrassCoverErosionInwards/DikeProfileCreateExtensions.cs (.../DikeProfileCreateExtensions.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -38,9 +38,10 @@ /// /// 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) + internal static DikeProfileEntity Create(this DikeProfile dikeProfile, PersistenceRegistry registry, int order) { if (registry == null) { @@ -60,7 +61,8 @@ ForeShoreData = new Point2DBinaryConverter().ToBytes(dikeProfile.ForeshoreGeometry), Orientation = dikeProfile.Orientation, DikeHeight = dikeProfile.DikeHeight, - Name = dikeProfile.Name + Name = dikeProfile.Name, + Order = order }; if (dikeProfile.HasBreakWater) { Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationCreateExtensions.cs =================================================================== diff -u -rbc7cd9cbf90d04580e6b3542c56edc590867c43a -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationCreateExtensions.cs (.../GrassCoverErosionInwardsCalculationCreateExtensions.cs) (revision bc7cd9cbf90d04580e6b3542c56edc590867c43a) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationCreateExtensions.cs (.../GrassCoverErosionInwardsCalculationCreateExtensions.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -72,11 +72,11 @@ { if (input.DikeProfile != null) { - entity.DikeProfileEntity = input.DikeProfile.Create(registry); + entity.DikeProfileEntity = registry.Get(input.DikeProfile); } if (input.HydraulicBoundaryLocation != null) { - entity.HydraulicLocationEntity = input.HydraulicBoundaryLocation.Create(registry); + entity.HydraulicLocationEntity = registry.Get(input.HydraulicBoundaryLocation); } entity.BreakWaterHeight = input.BreakWater.Height.Value.ToNaNAsNull(); Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismCreateExtensions.cs =================================================================== diff -u -r1e9309149f9387c4e8b10f6c5f429797220b0ef8 -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismCreateExtensions.cs (.../GrassCoverErosionInwardsFailureMechanismCreateExtensions.cs) (revision 1e9309149f9387c4e8b10f6c5f429797220b0ef8) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismCreateExtensions.cs (.../GrassCoverErosionInwardsFailureMechanismCreateExtensions.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -59,9 +59,10 @@ private static void AddEntitiesForDikeProfiles(GrassCoverErosionInwardsFailureMechanism mechanism, PersistenceRegistry registry, FailureMechanismEntity entity) { - foreach (DikeProfile dikeProfile in mechanism.DikeProfiles) + for (int i = 0; i < mechanism.DikeProfiles.Count; i++) { - entity.DikeProfileEntities.Add(dikeProfile.Create(registry)); + DikeProfile dikeProfile = mechanism.DikeProfiles[i]; + entity.DikeProfileEntities.Add(dikeProfile.Create(registry, i)); } } Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/HydraulicBoundaryLocationCreateExtensions.cs =================================================================== diff -u -r61ced0f990b10b560e2d5700b5851cdb188585db -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/HydraulicBoundaryLocationCreateExtensions.cs (.../HydraulicBoundaryLocationCreateExtensions.cs) (revision 61ced0f990b10b560e2d5700b5851cdb188585db) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/HydraulicBoundaryLocationCreateExtensions.cs (.../HydraulicBoundaryLocationCreateExtensions.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -35,9 +35,10 @@ /// /// 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 is null. - internal static HydraulicLocationEntity Create(this HydraulicBoundaryLocation location, PersistenceRegistry registry) + internal static HydraulicLocationEntity Create(this HydraulicBoundaryLocation location, PersistenceRegistry registry, int order) { if (registry == null) { @@ -55,7 +56,8 @@ LocationX = location.Location.X.ToNaNAsNull(), LocationY = location.Location.Y.ToNaNAsNull(), DesignWaterLevel = double.IsNaN(location.DesignWaterLevel) ? (double?) null : location.DesignWaterLevel, - WaveHeight = double.IsNaN(location.WaveHeight) ? (double?)null : location.WaveHeight + WaveHeight = double.IsNaN(location.WaveHeight) ? (double?)null : location.WaveHeight, + Order = order }; registry.Register(entity, location); Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingCalculationScenarioCreateExtensions.cs =================================================================== diff -u -r4f92f7d10dc5db623169cf9ff52f506ce0238e9f -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingCalculationScenarioCreateExtensions.cs (.../PipingCalculationScenarioCreateExtensions.cs) (revision 4f92f7d10dc5db623169cf9ff52f506ce0238e9f) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingCalculationScenarioCreateExtensions.cs (.../PipingCalculationScenarioCreateExtensions.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -69,15 +69,14 @@ { if (inputParameters.SurfaceLine != null) { - entity.SurfaceLineEntity = inputParameters.SurfaceLine.Create(registry); + entity.SurfaceLineEntity = registry.Get(inputParameters.SurfaceLine); } if (inputParameters.HydraulicBoundaryLocation != null) { - entity.HydraulicLocationEntity = inputParameters.HydraulicBoundaryLocation.Create(registry); + entity.HydraulicLocationEntity = registry.Get(inputParameters.HydraulicBoundaryLocation); } if (inputParameters.StochasticSoilProfile != null) { - inputParameters.StochasticSoilModel.Create(registry); entity.StochasticSoilProfileEntity = registry.Get(inputParameters.StochasticSoilProfile); } Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingFailureMechanismCreateExtensions.cs =================================================================== diff -u -r01ff2c58c13df8f42661ae3e446dc2caaa94247e -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingFailureMechanismCreateExtensions.cs (.../PipingFailureMechanismCreateExtensions.cs) (revision 01ff2c58c13df8f42661ae3e446dc2caaa94247e) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingFailureMechanismCreateExtensions.cs (.../PipingFailureMechanismCreateExtensions.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -75,17 +75,19 @@ private static void AddEntitiesForStochasticSoilModels(PipingFailureMechanism mechanism, PersistenceRegistry registry, FailureMechanismEntity entity) { + int index = 0; foreach (var stochasticSoilModel in mechanism.StochasticSoilModels) { - entity.StochasticSoilModelEntities.Add(stochasticSoilModel.Create(registry)); + entity.StochasticSoilModelEntities.Add(stochasticSoilModel.Create(registry, index++)); } } private static void AddEntitiesForSurfaceLines(PipingFailureMechanism mechanism, PersistenceRegistry registry, FailureMechanismEntity entity) { + int index = 0; foreach (RingtoetsPipingSurfaceLine surfaceLine in mechanism.SurfaceLines) { - entity.SurfaceLineEntities.Add(surfaceLine.Create(registry)); + entity.SurfaceLineEntities.Add(surfaceLine.Create(registry, index++)); } } } Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingSoilLayerCreateExtensions.cs =================================================================== diff -u -r01ff2c58c13df8f42661ae3e446dc2caaa94247e -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingSoilLayerCreateExtensions.cs (.../PipingSoilLayerCreateExtensions.cs) (revision 01ff2c58c13df8f42661ae3e446dc2caaa94247e) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingSoilLayerCreateExtensions.cs (.../PipingSoilLayerCreateExtensions.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -37,9 +37,10 @@ /// /// The layer 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 SoilLayerEntity Create(this PipingSoilLayer layer, PersistenceRegistry registry) + internal static SoilLayerEntity Create(this PipingSoilLayer layer, PersistenceRegistry registry, int order) { if (registry == null) { @@ -58,7 +59,8 @@ PermeabilityMean = layer.PermeabilityMean.ToNaNAsNull(), PermeabilityDeviation = layer.PermeabilityDeviation.ToNaNAsNull(), Color = layer.Color.ToArgb(), - MaterialName = layer.MaterialName + MaterialName = layer.MaterialName, + Order = order }; registry.Register(entity, layer); Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingSoilProfileCreateExtensions.cs =================================================================== diff -u -ra294987551b0b2d8a27b6e1bc6235b0e2351b6f4 -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingSoilProfileCreateExtensions.cs (.../PipingSoilProfileCreateExtensions.cs) (revision a294987551b0b2d8a27b6e1bc6235b0e2351b6f4) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingSoilProfileCreateExtensions.cs (.../PipingSoilProfileCreateExtensions.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -65,9 +65,10 @@ private static void AddEntitiesForPipingSoilLayers(PipingSoilProfile profile, PersistenceRegistry registry, SoilProfileEntity entity) { + int index = 0; foreach (var pipingSoilLayer in profile.Layers) { - entity.SoilLayerEntities.Add(pipingSoilLayer.Create(registry)); + entity.SoilLayerEntities.Add(pipingSoilLayer.Create(registry, index++)); } } } Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/RingtoetsPipingSurfaceLineCreateExtensions.cs =================================================================== diff -u -r508d720230c5f63bce7f95bddc3b7a04808d267d -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/RingtoetsPipingSurfaceLineCreateExtensions.cs (.../RingtoetsPipingSurfaceLineCreateExtensions.cs) (revision 508d720230c5f63bce7f95bddc3b7a04808d267d) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/RingtoetsPipingSurfaceLineCreateExtensions.cs (.../RingtoetsPipingSurfaceLineCreateExtensions.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -42,9 +42,10 @@ /// /// 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 is null. - internal static SurfaceLineEntity Create(this RingtoetsPipingSurfaceLine surfaceLine, PersistenceRegistry registry) + internal static SurfaceLineEntity Create(this RingtoetsPipingSurfaceLine surfaceLine, PersistenceRegistry registry, int order) { if (registry == null) { @@ -60,7 +61,8 @@ Name = surfaceLine.Name, ReferenceLineIntersectionX = surfaceLine.ReferenceLineIntersectionWorldPoint.X.ToNaNAsNull(), ReferenceLineIntersectionY = surfaceLine.ReferenceLineIntersectionWorldPoint.Y.ToNaNAsNull(), - PointsData = new Point3DBinaryConverter().ToBytes(surfaceLine.Points) + PointsData = new Point3DBinaryConverter().ToBytes(surfaceLine.Points), + Order = order }; CreateCharacteristicPointEntities(surfaceLine, registry, entity); Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/StochasticSoilModelCreateExtensions.cs =================================================================== diff -u -r508d720230c5f63bce7f95bddc3b7a04808d267d -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/StochasticSoilModelCreateExtensions.cs (.../StochasticSoilModelCreateExtensions.cs) (revision 508d720230c5f63bce7f95bddc3b7a04808d267d) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/StochasticSoilModelCreateExtensions.cs (.../StochasticSoilModelCreateExtensions.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -38,9 +38,10 @@ /// /// 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 is null. - internal static StochasticSoilModelEntity Create(this StochasticSoilModel model, PersistenceRegistry registry) + internal static StochasticSoilModelEntity Create(this StochasticSoilModel model, PersistenceRegistry registry, int order) { if (registry == null) { @@ -55,7 +56,8 @@ { Name = model.Name, SegmentName = model.SegmentName, - StochasticSoilModelSegmentPointData = new Point2DBinaryConverter().ToBytes(model.Geometry) + StochasticSoilModelSegmentPointData = new Point2DBinaryConverter().ToBytes(model.Geometry), + Order = order }; AddEntitiesForStochasticSoilProfiles(model, registry, entity); @@ -66,9 +68,10 @@ private static void AddEntitiesForStochasticSoilProfiles(StochasticSoilModel model, PersistenceRegistry registry, StochasticSoilModelEntity entity) { - foreach (var stochasticSoilProfile in model.StochasticSoilProfiles) + for (int i = 0; i < model.StochasticSoilProfiles.Count; i++) { - entity.StochasticSoilProfileEntities.Add(stochasticSoilProfile.Create(registry)); + var stochasticSoilProfile = model.StochasticSoilProfiles[i]; + entity.StochasticSoilProfileEntities.Add(stochasticSoilProfile.Create(registry, i)); } } } Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/StochasticSoilProfileCreateExtensions.cs =================================================================== diff -u -ra294987551b0b2d8a27b6e1bc6235b0e2351b6f4 -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/StochasticSoilProfileCreateExtensions.cs (.../StochasticSoilProfileCreateExtensions.cs) (revision a294987551b0b2d8a27b6e1bc6235b0e2351b6f4) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/StochasticSoilProfileCreateExtensions.cs (.../StochasticSoilProfileCreateExtensions.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -37,14 +37,16 @@ /// /// 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 StochasticSoilProfileEntity Create(this StochasticSoilProfile profile, PersistenceRegistry registry) + internal static StochasticSoilProfileEntity Create(this StochasticSoilProfile profile, PersistenceRegistry registry, int order) { var entity = new StochasticSoilProfileEntity { Probability = profile.Probability.ToNaNAsNull(), - SoilProfileEntity = profile.SoilProfile.Create(registry) + SoilProfileEntity = profile.SoilProfile.Create(registry), + Order = order }; if (registry.Contains(profile)) { Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/DatabaseStructure.sql =================================================================== diff -u -r61ced0f990b10b560e2d5700b5851cdb188585db -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/DatabaseStructure.sql (.../DatabaseStructure.sql) (revision 61ced0f990b10b560e2d5700b5851cdb188585db) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/DatabaseStructure.sql (.../DatabaseStructure.sql) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -1,6 +1,6 @@ /* ---------------------------------------------------- */ /* Generated by Enterprise Architect Version 12.0 */ -/* Created On : 05-aug-2016 09:03:36 */ +/* Created On : 05-aug-2016 15:32:59 */ /* DBMS : SQLite */ /* ---------------------------------------------------- */ @@ -215,6 +215,7 @@ 'LocationY' REAL, 'DesignWaterLevel' REAL, 'WaveHeight' REAL, + 'Order' INT (4) NOT NULL, CONSTRAINT 'FK_HydraulicLocationEntity_AssessmentSectionEntity' FOREIGN KEY ('AssessmentSectionEntityId') REFERENCES 'AssessmentSectionEntity' ('AssessmentSectionEntityId') ON DELETE Cascade ON UPDATE Cascade ) ; @@ -306,6 +307,7 @@ 'BelowPhreaticLevelShift' REAL, 'PermeabilityMean' REAL, 'PermeabilityDeviation' REAL, + 'Order' INT (4) NOT NULL, CONSTRAINT 'FK_SoilLayerEntity_SoilProfileEntity' FOREIGN KEY ('SoilProfileEntityId') REFERENCES 'SoilProfileEntity' ('SoilProfileEntityId') ON DELETE Cascade ON UPDATE Cascade ) ; @@ -316,6 +318,7 @@ 'SoilProfileEntityId' INTEGER NOT NULL, 'StochasticSoilModelEntityId' INTEGER NOT NULL, 'Probability' REAL, + 'Order' INT (4) NOT NULL, CONSTRAINT 'FK_StochasticSoilProfileEntity_SoilProfileEntity' FOREIGN KEY ('SoilProfileEntityId') REFERENCES 'SoilProfileEntity' ('SoilProfileEntityId') ON DELETE Cascade ON UPDATE Cascade, CONSTRAINT 'FK_StochasticSoilProfileEntity_StochasticSoilModelEntity' FOREIGN KEY ('StochasticSoilModelEntityId') REFERENCES 'StochasticSoilModelEntity' ('StochasticSoilModelEntityId') ON DELETE Cascade ON UPDATE Cascade ) @@ -328,6 +331,7 @@ 'Name' TEXT, 'SegmentName' TEXT, 'StochasticSoilModelSegmentPointData' BLOB NOT NULL, + 'Order' INT (4) NOT NULL, CONSTRAINT 'FK_StochasticSoilModelEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade ) ; @@ -340,6 +344,7 @@ 'ReferenceLineIntersectionX' REAL, 'ReferenceLineIntersectionY' REAL, 'PointsData' BLOB NOT NULL, + 'Order' INT (4) NOT NULL, CONSTRAINT 'FK_SurfaceLineEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE No Action ON UPDATE No Action ) ; @@ -604,6 +609,7 @@ 'X' REAL, 'Y' REAL, 'X0' REAL, + 'Order' INT (4) NOT NULL, CONSTRAINT 'FK_DikeProfileEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade ) ; Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/DikeProfileEntity.cs =================================================================== diff -u -ra294987551b0b2d8a27b6e1bc6235b0e2351b6f4 -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/DikeProfileEntity.cs (.../DikeProfileEntity.cs) (revision a294987551b0b2d8a27b6e1bc6235b0e2351b6f4) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/DikeProfileEntity.cs (.../DikeProfileEntity.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -53,6 +53,7 @@ public Nullable X { get; set; } public Nullable Y { get; set; } public Nullable X0 { get; set; } + public int Order { get; set; } public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/HydraulicLocationEntity.cs =================================================================== diff -u -r61ced0f990b10b560e2d5700b5851cdb188585db -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/HydraulicLocationEntity.cs (.../HydraulicLocationEntity.cs) (revision 61ced0f990b10b560e2d5700b5851cdb188585db) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/HydraulicLocationEntity.cs (.../HydraulicLocationEntity.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -50,6 +50,7 @@ public Nullable LocationY { get; set; } public Nullable DesignWaterLevel { get; set; } public Nullable WaveHeight { get; set; } + public int Order { get; set; } public virtual AssessmentSectionEntity AssessmentSectionEntity { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.Designer.cs =================================================================== diff -u -r4f92f7d10dc5db623169cf9ff52f506ce0238e9f -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.Designer.cs (.../RingtoetsEntities.Designer.cs) (revision 4f92f7d10dc5db623169cf9ff52f506ce0238e9f) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.Designer.cs (.../RingtoetsEntities.Designer.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -1,4 +1,4 @@ -// T4 code generation is enabled for model 'D:\repos\WettelijkToetsInstrumentarium\Application\Ringtoets\src\Application.Ringtoets.Storage\DbContext\RingtoetsEntities.edmx'. +// T4 code generation is enabled for model 'D:\Branch_WTI2017\Application\Ringtoets\src\Application.Ringtoets.Storage\DbContext\RingtoetsEntities.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. Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx =================================================================== diff -u -r61ced0f990b10b560e2d5700b5851cdb188585db -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx (.../RingtoetsEntities.edmx) (revision 61ced0f990b10b560e2d5700b5851cdb188585db) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx (.../RingtoetsEntities.edmx) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -4,7 +4,7 @@ - + @@ -67,6 +67,7 @@ + @@ -199,6 +200,7 @@ + @@ -348,6 +350,7 @@ + @@ -375,6 +378,7 @@ + @@ -384,6 +388,7 @@ + @@ -413,6 +418,7 @@ + @@ -1511,6 +1517,7 @@ + @@ -1687,6 +1694,7 @@ + @@ -1855,6 +1863,7 @@ + @@ -1886,6 +1895,7 @@ + @@ -1897,6 +1907,7 @@ + @@ -1931,6 +1942,7 @@ + @@ -2574,6 +2586,7 @@ + @@ -2722,6 +2735,7 @@ + @@ -2878,6 +2892,7 @@ + @@ -2916,6 +2931,7 @@ + @@ -2927,6 +2943,7 @@ + @@ -2957,6 +2974,7 @@ + Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx.diagram =================================================================== diff -u -r61ced0f990b10b560e2d5700b5851cdb188585db -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx.diagram (.../RingtoetsEntities.edmx.diagram) (revision 61ced0f990b10b560e2d5700b5851cdb188585db) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx.diagram (.../RingtoetsEntities.edmx.diagram) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -5,46 +5,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/SoilLayerEntity.cs =================================================================== diff -u -ra294987551b0b2d8a27b6e1bc6235b0e2351b6f4 -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/SoilLayerEntity.cs (.../SoilLayerEntity.cs) (revision a294987551b0b2d8a27b6e1bc6235b0e2351b6f4) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/SoilLayerEntity.cs (.../SoilLayerEntity.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -48,6 +48,7 @@ public Nullable BelowPhreaticLevelShift { get; set; } public Nullable PermeabilityMean { get; set; } public Nullable PermeabilityDeviation { get; set; } + public int Order { get; set; } public virtual SoilProfileEntity SoilProfileEntity { get; set; } } Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/StochasticSoilModelEntity.cs =================================================================== diff -u -r508d720230c5f63bce7f95bddc3b7a04808d267d -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/StochasticSoilModelEntity.cs (.../StochasticSoilModelEntity.cs) (revision 508d720230c5f63bce7f95bddc3b7a04808d267d) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/StochasticSoilModelEntity.cs (.../StochasticSoilModelEntity.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -46,6 +46,7 @@ public string Name { get; set; } public string SegmentName { get; set; } public byte[] StochasticSoilModelSegmentPointData { get; set; } + public int Order { get; set; } public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/StochasticSoilProfileEntity.cs =================================================================== diff -u -ra294987551b0b2d8a27b6e1bc6235b0e2351b6f4 -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/StochasticSoilProfileEntity.cs (.../StochasticSoilProfileEntity.cs) (revision a294987551b0b2d8a27b6e1bc6235b0e2351b6f4) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/StochasticSoilProfileEntity.cs (.../StochasticSoilProfileEntity.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -45,6 +45,7 @@ public long SoilProfileEntityId { get; set; } public long StochasticSoilModelEntityId { get; set; } public Nullable Probability { get; set; } + public int Order { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection PipingCalculationEntities { get; set; } Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/SurfaceLineEntity.cs =================================================================== diff -u -r508d720230c5f63bce7f95bddc3b7a04808d267d -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/SurfaceLineEntity.cs (.../SurfaceLineEntity.cs) (revision 508d720230c5f63bce7f95bddc3b7a04808d267d) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/SurfaceLineEntity.cs (.../SurfaceLineEntity.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -48,6 +48,7 @@ public Nullable ReferenceLineIntersectionX { get; set; } public Nullable ReferenceLineIntersectionY { get; set; } public byte[] PointsData { get; set; } + public int Order { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection CharacteristicPointEntities { get; set; } Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Update/AssessmentSectionUpdateExtensions.cs =================================================================== diff -u -rbb04ea61be6e4ce94cb1453c4578b0e9256168c4 -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/Update/AssessmentSectionUpdateExtensions.cs (.../AssessmentSectionUpdateExtensions.cs) (revision bb04ea61be6e4ce94cb1453c4578b0e9256168c4) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Update/AssessmentSectionUpdateExtensions.cs (.../AssessmentSectionUpdateExtensions.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -137,11 +137,12 @@ entity.HydraulicDatabaseLocation = section.HydraulicBoundaryDatabase.FilePath; entity.HydraulicDatabaseVersion = section.HydraulicBoundaryDatabase.Version; - foreach (var hydraulicBoundaryLocation in section.HydraulicBoundaryDatabase.Locations) + for (int i = 0; i < section.HydraulicBoundaryDatabase.Locations.Count; i++) { + var hydraulicBoundaryLocation = section.HydraulicBoundaryDatabase.Locations[i]; if (hydraulicBoundaryLocation.IsNew()) { - entity.HydraulicLocationEntities.Add(hydraulicBoundaryLocation.Create(registry)); + entity.HydraulicLocationEntities.Add(hydraulicBoundaryLocation.Create(registry, i)); } else { Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Update/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismUpdateExtensions.cs =================================================================== diff -u -rbb04ea61be6e4ce94cb1453c4578b0e9256168c4 -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/Update/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismUpdateExtensions.cs (.../GrassCoverErosionInwardsFailureMechanismUpdateExtensions.cs) (revision bb04ea61be6e4ce94cb1453c4578b0e9256168c4) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Update/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismUpdateExtensions.cs (.../GrassCoverErosionInwardsFailureMechanismUpdateExtensions.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -78,11 +78,12 @@ private static void UpdateDikeProfiles(GrassCoverErosionInwardsFailureMechanism mechanism, PersistenceRegistry registry, FailureMechanismEntity entity, IRingtoetsEntities context) { - foreach (DikeProfile dikeProfile in mechanism.DikeProfiles) + for (int i = 0; i < mechanism.DikeProfiles.Count; i++) { + DikeProfile dikeProfile = mechanism.DikeProfiles[i]; if (dikeProfile.IsNew()) { - entity.DikeProfileEntities.Add(dikeProfile.Create(registry)); + entity.DikeProfileEntities.Add(dikeProfile.Create(registry, i)); } else { Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Update/Piping/PipingFailureMechanismUpdateExtensions.cs =================================================================== diff -u -rbb04ea61be6e4ce94cb1453c4578b0e9256168c4 -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/Update/Piping/PipingFailureMechanismUpdateExtensions.cs (.../PipingFailureMechanismUpdateExtensions.cs) (revision bb04ea61be6e4ce94cb1453c4578b0e9256168c4) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Update/Piping/PipingFailureMechanismUpdateExtensions.cs (.../PipingFailureMechanismUpdateExtensions.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -95,11 +95,12 @@ private static void UpdateSoilModels(PipingFailureMechanism mechanism, PersistenceRegistry registry, IRingtoetsEntities context, FailureMechanismEntity entity) { - foreach (var stochasticSoilModel in mechanism.StochasticSoilModels) + for (int index = 0; index < mechanism.StochasticSoilModels.Count; index++) { + var stochasticSoilModel = mechanism.StochasticSoilModels[index]; if (stochasticSoilModel.IsNew()) { - entity.StochasticSoilModelEntities.Add(stochasticSoilModel.Create(registry)); + entity.StochasticSoilModelEntities.Add(stochasticSoilModel.Create(registry, index)); } else { @@ -110,16 +111,18 @@ private static void UpdateSurfaceLines(PipingFailureMechanism failureMechanism, PersistenceRegistry registry, IRingtoetsEntities context, FailureMechanismEntity entity) { + int index = 0; foreach (RingtoetsPipingSurfaceLine surfaceLine in failureMechanism.SurfaceLines) { if (surfaceLine.IsNew()) { - entity.SurfaceLineEntities.Add(surfaceLine.Create(registry)); + entity.SurfaceLineEntities.Add(surfaceLine.Create(registry, index)); } else { surfaceLine.Update(registry, context); } + index++; } } } Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Update/Piping/PipingSoilProfileUpdateExtensions.cs =================================================================== diff -u -rbb04ea61be6e4ce94cb1453c4578b0e9256168c4 -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/Update/Piping/PipingSoilProfileUpdateExtensions.cs (.../PipingSoilProfileUpdateExtensions.cs) (revision bb04ea61be6e4ce94cb1453c4578b0e9256168c4) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Update/Piping/PipingSoilProfileUpdateExtensions.cs (.../PipingSoilProfileUpdateExtensions.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -67,16 +67,18 @@ entity.Name = profile.Name; entity.Bottom = profile.Bottom.ToNaNAsNull(); + int index = 0; foreach (var pipingSoilLayer in profile.Layers) { if (pipingSoilLayer.IsNew()) { - entity.SoilLayerEntities.Add(pipingSoilLayer.Create(registry)); + entity.SoilLayerEntities.Add(pipingSoilLayer.Create(registry, index)); } else { pipingSoilLayer.Update(registry, context); } + index++; } registry.Register(entity, profile); Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Update/Piping/StochasticSoilModelUpdateExtensions.cs =================================================================== diff -u -rbb04ea61be6e4ce94cb1453c4578b0e9256168c4 -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/src/Application.Ringtoets.Storage/Update/Piping/StochasticSoilModelUpdateExtensions.cs (.../StochasticSoilModelUpdateExtensions.cs) (revision bb04ea61be6e4ce94cb1453c4578b0e9256168c4) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Update/Piping/StochasticSoilModelUpdateExtensions.cs (.../StochasticSoilModelUpdateExtensions.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -76,11 +76,12 @@ private static void UpdateStochasticSoilProfiles(StochasticSoilModel model, StochasticSoilModelEntity entity, PersistenceRegistry registry, IRingtoetsEntities context) { - foreach (var stochasticSoilProfile in model.StochasticSoilProfiles) + for (int index = 0; index < model.StochasticSoilProfiles.Count; index++) { + var stochasticSoilProfile = model.StochasticSoilProfiles[index]; if (stochasticSoilProfile.IsNew()) { - entity.StochasticSoilProfileEntities.Add(stochasticSoilProfile.Create(registry)); + entity.StochasticSoilProfileEntities.Add(stochasticSoilProfile.Create(registry, index)); } else { Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionInwards/DikeProfileCreateExtensionsTest.cs =================================================================== diff -u -rbc7cd9cbf90d04580e6b3542c56edc590867c43a -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionInwards/DikeProfileCreateExtensionsTest.cs (.../DikeProfileCreateExtensionsTest.cs) (revision bc7cd9cbf90d04580e6b3542c56edc590867c43a) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionInwards/DikeProfileCreateExtensionsTest.cs (.../DikeProfileCreateExtensionsTest.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -56,7 +56,7 @@ new DikeProfile.ConstructionProperties()); // Call - TestDelegate call = () => dikeProfile.Create(null); + TestDelegate call = () => dikeProfile.Create(null, 0); // Assert string paramName = Assert.Throws(call).ParamName; @@ -67,6 +67,7 @@ public void Create_WithoutBreakWater_ReturnEntityWithNullBreakWaterProperties() { // Setup + var order = new Random(22).Next(); var dikeProfile = new DikeProfile(new Point2D(1.1, 2.2), new[] { @@ -89,12 +90,13 @@ var registry = new PersistenceRegistry(); // Call - DikeProfileEntity entity = dikeProfile.Create(registry); + DikeProfileEntity entity = dikeProfile.Create(registry, order); // Assert Assert.AreEqual(dikeProfile.WorldReferencePoint.X, entity.X); Assert.AreEqual(dikeProfile.WorldReferencePoint.Y, entity.Y); Assert.AreEqual(dikeProfile.X0, entity.X0); + Assert.AreEqual(order, entity.Order); byte[] convertedDikeGeometry = new RoughnessPointBinaryConverter().ToBytes(dikeProfile.DikeGeometry); CollectionAssert.AreEqual(convertedDikeGeometry, entity.DikeGeometryData); byte[] convertedForeshoreGeometry = new Point2DBinaryConverter().ToBytes(dikeProfile.ForeshoreGeometry); @@ -114,6 +116,7 @@ public void Create_WithBreakWater_ReturnEntity(BreakWaterType type, double height) { // Setup + var order = new Random(42).Next(); var dikeProfile = new DikeProfile(new Point2D(1234.4567, 5678.432), new[] { @@ -136,12 +139,13 @@ var registry = new PersistenceRegistry(); // Call - DikeProfileEntity entity = dikeProfile.Create(registry); + DikeProfileEntity entity = dikeProfile.Create(registry, order); // Assert Assert.AreEqual(dikeProfile.WorldReferencePoint.X, entity.X); Assert.AreEqual(dikeProfile.WorldReferencePoint.Y, entity.Y); Assert.AreEqual(dikeProfile.X0, entity.X0); + Assert.AreEqual(order, entity.Order); byte[] convertedDikeGeometry = new RoughnessPointBinaryConverter().ToBytes(dikeProfile.DikeGeometry); CollectionAssert.AreEqual(convertedDikeGeometry, entity.DikeGeometryData); byte[] convertedForeshoreGeometry = new Point2DBinaryConverter().ToBytes(dikeProfile.ForeshoreGeometry); @@ -172,7 +176,7 @@ var registry = new PersistenceRegistry(); // Call - DikeProfileEntity entity = dikeProfile.Create(registry); + DikeProfileEntity entity = dikeProfile.Create(registry, 0); // Assert entity.DikeProfileEntityId = 345678; @@ -196,13 +200,13 @@ new Point2D(9.9, 10.10) }, null, new DikeProfile.ConstructionProperties()); var registry = new PersistenceRegistry(); - DikeProfileEntity entity1 = dikeProfile.Create(registry); + DikeProfileEntity entity1 = dikeProfile.Create(registry, 0); // Precondition: Assert.IsTrue(registry.Contains(dikeProfile)); // Call - DikeProfileEntity entity2 = dikeProfile.Create(registry); + DikeProfileEntity entity2 = dikeProfile.Create(registry, 0); // Assert Assert.AreSame(entity1, entity2); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationCreateExtensionsTest.cs =================================================================== diff -u -rbc7cd9cbf90d04580e6b3542c56edc590867c43a -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationCreateExtensionsTest.cs (.../GrassCoverErosionInwardsCalculationCreateExtensionsTest.cs) (revision bc7cd9cbf90d04580e6b3542c56edc590867c43a) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationCreateExtensionsTest.cs (.../GrassCoverErosionInwardsCalculationCreateExtensionsTest.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -190,30 +190,6 @@ } [Test] - public void Create_CalculationWithNewDikeProfile_ReturnEntityWithDikeProfileEntity() - { - // Setup - var dikeProfile = new DikeProfile(new Point2D(0, 0), new RoughnessPoint[0], - new Point2D[0], null, new DikeProfile.ConstructionProperties()); - var calculation = new GrassCoverErosionInwardsCalculation - { - InputParameters = - { - DikeProfile = dikeProfile - } - }; - - var registry = new PersistenceRegistry(); - - // Call - GrassCoverErosionInwardsCalculationEntity entity = calculation.Create(registry, 0); - - // Assert - Assert.IsTrue(registry.Contains(dikeProfile)); - Assert.IsNotNull(entity.DikeProfileEntity); - } - - [Test] public void Create_CalculationWithAlreadySavedHydraulicBoundaryLocation_ReturnEntityWithHydraulicLocationEntity() { // Setup @@ -238,29 +214,6 @@ } [Test] - public void Create_CalculationWithNewHydraulicBoundaryLocation_ReturnEntityWithHydraulicLocationEntity() - { - // Setup - var hydroLocation = new HydraulicBoundaryLocation(1, "A", 1, 1); - var calculation = new GrassCoverErosionInwardsCalculation - { - InputParameters = - { - HydraulicBoundaryLocation = hydroLocation - } - }; - - var registry = new PersistenceRegistry(); - - // Call - GrassCoverErosionInwardsCalculationEntity entity = calculation.Create(registry, 0); - - // Assert - Assert.IsTrue(registry.Contains(hydroLocation)); - Assert.IsNotNull(entity.HydraulicLocationEntity); - } - - [Test] public void Create_CalculationWithOutput_ReturnEntity() { // Setup Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/HydraulicBoundaryLocationCreateExtensionsTest.cs =================================================================== diff -u -r61ced0f990b10b560e2d5700b5851cdb188585db -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/HydraulicBoundaryLocationCreateExtensionsTest.cs (.../HydraulicBoundaryLocationCreateExtensionsTest.cs) (revision 61ced0f990b10b560e2d5700b5851cdb188585db) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/HydraulicBoundaryLocationCreateExtensionsTest.cs (.../HydraulicBoundaryLocationCreateExtensionsTest.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -38,7 +38,7 @@ var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(-1, "testName", 2, 3); // Call - TestDelegate test = () => hydraulicBoundaryLocation.Create(null); + TestDelegate test = () => hydraulicBoundaryLocation.Create(null, 0); // Assert var parameterName = Assert.Throws(test).ParamName; @@ -54,11 +54,12 @@ var coordinateX = random.NextDouble(); var coordinateY = random.NextDouble(); var id = random.Next(0,150); + int order = random.Next(); var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(id, testName, coordinateX, coordinateY); var registry = new PersistenceRegistry(); // Call - var entity = hydraulicBoundaryLocation.Create(registry); + var entity = hydraulicBoundaryLocation.Create(registry, order); // Assert Assert.IsNotNull(entity); @@ -68,6 +69,7 @@ Assert.AreEqual(id, entity.LocationId); Assert.IsNull(entity.DesignWaterLevel); Assert.IsNull(entity.WaveHeight); + Assert.AreEqual(order, entity.Order); } [Test] @@ -85,7 +87,7 @@ var registry = new PersistenceRegistry(); // Call - var entity = hydraulicBoundaryLocation.Create(registry); + var entity = hydraulicBoundaryLocation.Create(registry, 0); // Assert Assert.IsNotNull(entity); @@ -102,8 +104,8 @@ var registry = new PersistenceRegistry(); // Call - HydraulicLocationEntity entity1 = hydraulicBoundaryLocations.Create(registry); - HydraulicLocationEntity entity2 = hydraulicBoundaryLocations.Create(registry); + HydraulicLocationEntity entity1 = hydraulicBoundaryLocations.Create(registry, 0); + HydraulicLocationEntity entity2 = hydraulicBoundaryLocations.Create(registry, 0); // Assert Assert.AreSame(entity1, entity2); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingCalculationScenarioCreateExtensionsTest.cs =================================================================== diff -u -r2363244674e6b7b97bead9a6855806420d368d80 -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingCalculationScenarioCreateExtensionsTest.cs (.../PipingCalculationScenarioCreateExtensionsTest.cs) (revision 2363244674e6b7b97bead9a6855806420d368d80) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingCalculationScenarioCreateExtensionsTest.cs (.../PipingCalculationScenarioCreateExtensionsTest.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -148,7 +148,7 @@ }); var registry = new PersistenceRegistry(); - SurfaceLineEntity surfaceLineEntity = surfaceLine.Create(registry); + SurfaceLineEntity surfaceLineEntity = surfaceLine.Create(registry, 0); var calculation = new PipingCalculationScenario(new GeneralPipingInput()) { @@ -166,45 +166,13 @@ } [Test] - public void Create_HasSurfaceLineSetButInstanceNotSaved_EntityHasNewSurfaceLineEntity() - { - // Setup - var surfaceLine = new RingtoetsPipingSurfaceLine - { - ReferenceLineIntersectionWorldPoint = new Point2D(1.1, 2.2) - }; - surfaceLine.SetGeometry(new[] - { - new Point3D(0.0, 0.0, 1.0), - new Point3D(3.3, 6.6, 1.0) - }); - - var registry = new PersistenceRegistry(); - - var calculation = new PipingCalculationScenario(new GeneralPipingInput()) - { - InputParameters = - { - SurfaceLine = surfaceLine - } - }; - - // Call - PipingCalculationEntity entity = calculation.Create(registry, 0); - - // Assert - Assert.True(registry.Contains(surfaceLine)); - Assert.AreSame(registry.Get(surfaceLine), entity.SurfaceLineEntity); - } - - [Test] public void Create_HydraulicBoundaryLocation_EntityHasHydraulicLocationEntity() { // Setup var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "A", 2.3, 4.5); var registry = new PersistenceRegistry(); - HydraulicLocationEntity hydraulicLocationEntity = hydraulicBoundaryLocation.Create(registry); + HydraulicLocationEntity hydraulicLocationEntity = hydraulicBoundaryLocation.Create(registry, 0); var calculation = new PipingCalculationScenario(new GeneralPipingInput()) { @@ -222,28 +190,6 @@ } [Test] - public void Create_HasHydraulicBoundaryLocationSetButInstanceNotSaved_EntityHasNewHydraulicLocationEntity() - { - // Setup - var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "a", 1.1, 2.2); - var registry = new PersistenceRegistry(); - var calculation = new PipingCalculationScenario(new GeneralPipingInput()) - { - InputParameters = - { - HydraulicBoundaryLocation = hydraulicBoundaryLocation - } - }; - - // Call - PipingCalculationEntity entity = calculation.Create(registry, 0); - - // Assert - Assert.True(registry.Contains(hydraulicBoundaryLocation)); - Assert.AreSame(registry.Get(hydraulicBoundaryLocation), entity.HydraulicLocationEntity); - } - - [Test] public void Create_StochasticSoilProfileSet_EntityHasStochasticSoilProfileEntity() { // Setup @@ -257,7 +203,7 @@ soilModel.StochasticSoilProfiles.Add(stochasticSoilProfile); var registry = new PersistenceRegistry(); - StochasticSoilModelEntity soilModelEntity = soilModel.Create(registry); + StochasticSoilModelEntity soilModelEntity = soilModel.Create(registry, 0); var calculation = new PipingCalculationScenario(new GeneralPipingInput()) { @@ -278,38 +224,6 @@ } [Test] - public void Create_HasStochasticSoilProfileSetButInstanceNotSaved_EntityHasNewStochasticSoilProfileEntity() - { - // Setup - var soilProfile = new TestPipingSoilProfile(); - var stochasticSoilProfile = new StochasticSoilProfile(0.6, SoilProfileType.SoilProfile1D, 1) - { - SoilProfile = soilProfile - }; - - var soilModel = new StochasticSoilModel(1, "A", "B"); - soilModel.StochasticSoilProfiles.Add(stochasticSoilProfile); - - var registry = new PersistenceRegistry(); - var calculation = new PipingCalculationScenario(new GeneralPipingInput()) - { - InputParameters = - { - StochasticSoilModel = soilModel, - StochasticSoilProfile = stochasticSoilProfile - } - }; - - // Call - PipingCalculationEntity entity = calculation.Create(registry, 0); - - // Assert - Assert.True(registry.Contains(soilModel)); - Assert.True(registry.Contains(stochasticSoilProfile)); - Assert.AreSame(registry.Get(stochasticSoilProfile), entity.StochasticSoilProfileEntity); - } - - [Test] public void Create_HasCalculationOutput_EntityHasPipingCalculationOutputEntity() { // Setup Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingSoilLayerCreateExtensionsTest.cs =================================================================== diff -u -ra294987551b0b2d8a27b6e1bc6235b0e2351b6f4 -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingSoilLayerCreateExtensionsTest.cs (.../PipingSoilLayerCreateExtensionsTest.cs) (revision a294987551b0b2d8a27b6e1bc6235b0e2351b6f4) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingSoilLayerCreateExtensionsTest.cs (.../PipingSoilLayerCreateExtensionsTest.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -41,7 +41,7 @@ var soilLayer = new PipingSoilLayer(new Random(21).NextDouble()); // Call - TestDelegate test = () => soilLayer.Create(null); + TestDelegate test = () => soilLayer.Create(null, 0); // Assert var parameterName = Assert.Throws(test).ParamName; @@ -54,8 +54,9 @@ public void Create_WithCollector_ReturnsFailureMechanismEntityWithPropertiesSet(bool isAquifer) { // Setup - double top = new Random(21).NextDouble(); var random = new Random(21); + double top = random.NextDouble(); + int order = random.Next(); var soilLayer = new PipingSoilLayer(top) { IsAquifer = isAquifer, @@ -68,12 +69,11 @@ DiameterD70Deviation = double.NaN, PermeabilityMean = random.NextDouble(), PermeabilityDeviation = random.NextDouble() - }; var registry = new PersistenceRegistry(); // Call - var entity = soilLayer.Create(registry); + var entity = soilLayer.Create(registry, order); // Assert Assert.IsNotNull(entity); @@ -87,6 +87,7 @@ Assert.AreEqual(soilLayer.DiameterD70Deviation.ToNaNAsNull(), entity.DiameterD70Deviation); Assert.AreEqual(soilLayer.PermeabilityMean.ToNaNAsNull(), entity.PermeabilityMean); Assert.AreEqual(soilLayer.PermeabilityDeviation.ToNaNAsNull(), entity.PermeabilityDeviation); + Assert.AreEqual(order, entity.Order); } } } \ No newline at end of file Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/RingtoetsPipingSurfaceLineCreateExtensionsTest.cs =================================================================== diff -u -r508d720230c5f63bce7f95bddc3b7a04808d267d -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/RingtoetsPipingSurfaceLineCreateExtensionsTest.cs (.../RingtoetsPipingSurfaceLineCreateExtensionsTest.cs) (revision 508d720230c5f63bce7f95bddc3b7a04808d267d) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/RingtoetsPipingSurfaceLineCreateExtensionsTest.cs (.../RingtoetsPipingSurfaceLineCreateExtensionsTest.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -45,7 +45,7 @@ var surfaceLine = new RingtoetsPipingSurfaceLine(); // Call - TestDelegate call = () => surfaceLine.Create(null); + TestDelegate call = () => surfaceLine.Create(null, 0); // Assert Assert.Throws(call); @@ -55,6 +55,7 @@ public void Create_SurfaceLineWithoutGeometry_ReturnSurfaceLineEntityWithoutAddingPointEntities() { // Setup + var order = new Random(96).Next(); var registry = new PersistenceRegistry(); var surfaceLine = new RingtoetsPipingSurfaceLine { @@ -63,12 +64,13 @@ }; // Call - SurfaceLineEntity entity = surfaceLine.Create(registry); + SurfaceLineEntity entity = surfaceLine.Create(registry, order); // Assert Assert.AreEqual(surfaceLine.Name, entity.Name); Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.X, entity.ReferenceLineIntersectionX); Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.Y, entity.ReferenceLineIntersectionY); + Assert.AreEqual(order, entity.Order); Assert.AreEqual(0, entity.SurfaceLineEntityId); Assert.AreEqual(0, entity.FailureMechanismEntityId); @@ -80,6 +82,7 @@ public void Create_SurfaceLineWithGeometryWithoutCharacteristicPoints_ReturnSurfaceLineEntityWithPointEntities() { // Setup + var order = new Random(21).Next(); var registry = new PersistenceRegistry(); var geometry = new[] { @@ -95,12 +98,13 @@ surfaceLine.SetGeometry(geometry); // Call - SurfaceLineEntity entity = surfaceLine.Create(registry); + SurfaceLineEntity entity = surfaceLine.Create(registry, order); // Assert Assert.AreEqual(surfaceLine.Name, entity.Name); Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.X, entity.ReferenceLineIntersectionX); Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.Y, entity.ReferenceLineIntersectionY); + Assert.AreEqual(order, entity.Order); byte[] expectedBinaryData = new Point3DBinaryConverter().ToBytes(geometry); CollectionAssert.AreEqual(expectedBinaryData, entity.PointsData); @@ -146,7 +150,7 @@ surfaceLine.SetDitchPolderSideAt(geometry[ditchPolderIndex]); // Call - SurfaceLineEntity entity = surfaceLine.Create(registry); + SurfaceLineEntity entity = surfaceLine.Create(registry, 0); // Assert Assert.AreEqual(surfaceLine.Name, entity.Name); @@ -225,7 +229,7 @@ surfaceLine.SetDitchPolderSideAt(geometry[0]); // Call - SurfaceLineEntity entity = surfaceLine.Create(registry); + SurfaceLineEntity entity = surfaceLine.Create(registry, 0); // Assert Assert.AreEqual(surfaceLine.Name, entity.Name); @@ -262,7 +266,7 @@ }; // Call - surfaceLine.Create(registry); + surfaceLine.Create(registry, 0); // Assert Assert.IsTrue(registry.Contains(surfaceLine)); @@ -280,8 +284,8 @@ var registry = new PersistenceRegistry(); // Call - SurfaceLineEntity entity1 = surfaceLine.Create(registry); - SurfaceLineEntity entity2 = surfaceLine.Create(registry); + SurfaceLineEntity entity1 = surfaceLine.Create(registry, 0); + SurfaceLineEntity entity2 = surfaceLine.Create(registry, 0); // Assert Assert.AreSame(entity1, entity2); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/StochasticSoilModelCreateExtensionsTest.cs =================================================================== diff -u -r508d720230c5f63bce7f95bddc3b7a04808d267d -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/StochasticSoilModelCreateExtensionsTest.cs (.../StochasticSoilModelCreateExtensionsTest.cs) (revision 508d720230c5f63bce7f95bddc3b7a04808d267d) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/StochasticSoilModelCreateExtensionsTest.cs (.../StochasticSoilModelCreateExtensionsTest.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -47,7 +47,7 @@ var stochasticSoilModel = new TestStochasticSoilModel(); // Call - TestDelegate test = () => stochasticSoilModel.Create(null); + TestDelegate test = () => stochasticSoilModel.Create(null, 0); // Assert var parameterName = Assert.Throws(test).ParamName; @@ -58,18 +58,20 @@ public void Create_WithCollector_ReturnsStochasticSoilModelEntityWithPropertiesSet() { // Setup + var order = new Random(1).Next(); string testName = "testName"; string testSegmentName = "testSegmentName"; var stochasticSoilModel = new StochasticSoilModel(-1, testName, testSegmentName); var registry = new PersistenceRegistry(); // Call - var entity = stochasticSoilModel.Create(registry); + var entity = stochasticSoilModel.Create(registry, order); // Assert Assert.IsNotNull(entity); Assert.AreEqual(testName, entity.Name); Assert.AreEqual(testSegmentName, entity.SegmentName); + Assert.AreEqual(order, entity.Order); Assert.IsEmpty(entity.StochasticSoilProfileEntities); } @@ -89,7 +91,7 @@ var registry = new PersistenceRegistry(); // Call - var entity = stochasticSoilModel.Create(registry); + var entity = stochasticSoilModel.Create(registry, 0); // Assert Assert.IsNotNull(entity); @@ -109,7 +111,7 @@ var registry = new PersistenceRegistry(); // Call - var entity = stochasticSoilModel.Create(registry); + var entity = stochasticSoilModel.Create(registry, 0); // Assert Assert.IsNotNull(entity); @@ -126,8 +128,8 @@ var registry = new PersistenceRegistry(); // Call - StochasticSoilModelEntity entity1 = soilModel.Create(registry); - StochasticSoilModelEntity entity2 = soilModel.Create(registry); + StochasticSoilModelEntity entity1 = soilModel.Create(registry, 0); + StochasticSoilModelEntity entity2 = soilModel.Create(registry, 0); // Assert Assert.AreSame(entity1, entity2); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/StochasticSoilProfileCreateExtensionsTest.cs =================================================================== diff -u -r01ff2c58c13df8f42661ae3e446dc2caaa94247e -r37aadd6a7b1a13ef1c8809b3479df0911c6632bb --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/StochasticSoilProfileCreateExtensionsTest.cs (.../StochasticSoilProfileCreateExtensionsTest.cs) (revision 01ff2c58c13df8f42661ae3e446dc2caaa94247e) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/StochasticSoilProfileCreateExtensionsTest.cs (.../StochasticSoilProfileCreateExtensionsTest.cs) (revision 37aadd6a7b1a13ef1c8809b3479df0911c6632bb) @@ -43,7 +43,7 @@ var stochasticSoilProfile = new StochasticSoilProfile(40, SoilProfileType.SoilProfile1D, -1); // Call - TestDelegate test = () => stochasticSoilProfile.Create(null); + TestDelegate test = () => stochasticSoilProfile.Create(null, 0); // Assert var parameterName = Assert.Throws(test).ParamName; @@ -54,19 +54,22 @@ public void Create_WithCollector_ReturnsStochasticSoilProfileEntityWithPropertiesSet() { // Setup - var probability = new Random(21).NextDouble(); + var random = new Random(21); + double probability = random.NextDouble(); + int order = random.Next(); var stochasticSoilProfile = new StochasticSoilProfile(probability, SoilProfileType.SoilProfile1D, -1) { SoilProfile = new TestPipingSoilProfile() }; var registry = new PersistenceRegistry(); // Call - var entity = stochasticSoilProfile.Create(registry); + var entity = stochasticSoilProfile.Create(registry, order); // Assert Assert.IsNotNull(entity); Assert.AreEqual(probability, entity.Probability); + Assert.AreEqual(order, entity.Order); } [Test] @@ -85,8 +88,8 @@ var registry = new PersistenceRegistry(); // Call - var firstEntity = firstStochasticSoilProfile.Create(registry); - var secondEntity = secondStochasticSoilProfile.Create(registry); + var firstEntity = firstStochasticSoilProfile.Create(registry, 0); + var secondEntity = secondStochasticSoilProfile.Create(registry, 0); // Assert Assert.AreSame(firstEntity.SoilProfileEntity, secondEntity.SoilProfileEntity); @@ -105,8 +108,8 @@ var registry = new PersistenceRegistry(); // Call - StochasticSoilProfileEntity entity1 = stochasticSoilProfile.Create(registry); - StochasticSoilProfileEntity entity2 = stochasticSoilProfile.Create(registry); + StochasticSoilProfileEntity entity1 = stochasticSoilProfile.Create(registry, 0); + StochasticSoilProfileEntity entity2 = stochasticSoilProfile.Create(registry, 0); // Assert Assert.AreSame(entity1, entity2);