public ActionResult Edit(int id, ClassInfo data) { try { dbcontext.Entry(data).State = System.Data.Entity.EntityState.Modified; dbcontext.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int id, ClassInfo data) { try { // TODO: Add update logic here dbcontext.ClassInfo.Attach(data); dbcontext.Entry(data).State = System.Data.Entity.EntityState.Modified; dbcontext.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }