batch updates using Entity Framework

400 Views Asked by At

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.

1

There are 1 best solutions below

2
On

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.