Skip to content

Insert Order #467

Closed as not planned
Closed as not planned
@rubenalves

Description

@rubenalves

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions