Reputation: 89
Can anyone suggest me how to deal with batch updates using Entity Framework?
For ex: Updating a field for a list (List) of between 100 and 1000 Id's, which the primary key. Calling each update separately seem to be to much overhead and takes a long time.
Upvotes: 4
Views: 398
Reputation: 2037
Until you call SaveChanges()
none of the data is updated in the database so you can make how many changes you'd like.
You can take a look at a Unit of Work design pattern if you want a more structured way of saving changes to the database.
Upvotes: 1