public ActionResult Edit([Bind(Include = "fname,lname,phone,mailid,pwd")] user user) { if (ModelState.IsValid) { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
public void Update(Societe societe) { using (var db = new modelEntities1()) { var original = db.Societe.Find(societe.Id); if (original != null) { db.Entry(original).CurrentValues.SetValues(societe); db.SaveChanges(); } } }