You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noticed that when i add several items to a DbSet, example,
db.Products.Add(new Product{ID = 1, Name = "Product 1"});
db.Products.Add(new Product{ID = 2, Name = "Product 2"});
db.Products.Add(new Product{ID = 3, Name = "Product 3"});
When db.SaveChages() is called the data is inserted in the database but the order is random, not the order that the products where inserted in the collection.
Is it possible to make the ID column not identity and specify the ID manually as in my example?
The text was updated successfully, but these errors were encountered:
You'll also be able to use the [DatabaseGenerated] attribute once Data Annotation support is enabled in EF7.
We do also have #703 tracking the ability to explicitly insert values into a column that is configured as identity (for a set of well-known seed data etc.).
I have noticed that when i add several items to a DbSet, example,
db.Products.Add(new Product{ID = 1, Name = "Product 1"});
db.Products.Add(new Product{ID = 2, Name = "Product 2"});
db.Products.Add(new Product{ID = 3, Name = "Product 3"});
When db.SaveChages() is called the data is inserted in the database but the order is random, not the order that the products where inserted in the collection.
Is it possible to make the ID column not identity and specify the ID manually as in my example?
The text was updated successfully, but these errors were encountered: