Please have a look into the below sample example of a Controller Action method which is used to bulk update data using Entity Framework:-
[HttpPost]
public ActionResult Index(List<Contact> contactList)
{
using (ContactEntities contactEntities = new ContactEntities())
{
foreach (var contact in contactList)
{
var cnct = contactEntities.Contacts.Where(c => c.ContactID.Equals(contact.ContactID)).FirstOrDefault();
if (cnct != null)
{
cnct.ContactPerson = contact.ContactPerson;
cnct.Contactno = contact.Contactno;
cnct.EmailID = contact.EmailID;
}
}
contactEntities.SaveChanges();
}
ViewBag.Message = "Successfully Updated.";
return View(contactList);
}
Hope this will be of help to you.