public ActionResult Edit(Volunteer volunteer) { VolunteerContext volunteerContext = new VolunteerContext(); volunteerContext.Entry(volunteer).State = System.Data.Entity.EntityState.Modified; volunteerContext.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Email,FirstName,LastName,Username,Password,Center,Interests,Availability,Address,PhoneNumber,Education,Licenses,EMCname,EMCphone,EMCemail,EMCaddress,DriversLicenseOnFile,SocialCardOnFile,ApprovalStatus")] VolunteerModel volunteerModel) { if (ModelState.IsValid) { db.Entry(volunteerModel).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(volunteerModel)); }
public virtual void Update(T entity) { dbset.Attach(entity); dataContext.Entry(entity).State = EntityState.Modified; }