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));
}
}
}