How to Bulk Update records in Entity Framework?

If you don’t want to use an SQL statement, you can use the Attach method in order to update an entity without having to load it first : using (myDbEntities db = new myDbEntities()) { try { //disable detection of changes to improve performance db.Configuration.AutoDetectChangesEnabled = false; //for all the entities to update… MyObjectEntity entityToUpdate … Read more