I noticed strange behavior in my import service today when I tried to import multiple data records.
When I do this like this, all data records are imported and the values automatically increase ( see screenshot ):
public void Create(List<Property> properties)
{
foreach (Property prop in properties) {
dbc.Property.InsertOnSubmit(prop);
dbc.SubmitChanges();
}
}
When I try to do this, only the first data record gets the correct auto-increment value ( see screenshot ):
foreach (Property prop in properties) {
dbc.Property.InsertOnSubmit(prop);
}
dbc.SubmitChanges();
Same:
dbc.Property.InsertAllOnSubmit(properties);
dbc.SubmitChanges();
Does anyone have an idea why this is so? All three options should import all data records in accordance with my understanding, but missing automatically increasing values indicate that this is not so.
[EDIT] Added two screenshots.