Does "context.BulkInsert(...)" save changes or I have to use "SaveChanges()"?

Sep 24, 2014 at 10:35 PM
A simple and short question:

I'm not clear if I have to call context.SaveChanges() after using context.BulkInsert(entities).

Does context.BulkInsert(entities) save changes at the end?
Sep 25, 2014 at 8:11 AM
Hi,

You don't need to call SaveChanges(), BulkInsert insert data in database with SqlBulkCopy, he doesn't care about SaveChanges().

But SaveChanges() make a call to the DetectChanges() method of the context, it's not bad to verify your pocos integrity at the end of your treatment

Pierre-Luc
Marked as answer by germanger on 9/25/2014 at 9:33 AM