public ActionResult Edit([Bind(Include = "Id,Name,Active")] Student student) { if (ModelState.IsValid) { db.Entry(student).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(student)); }
public ActionResult Edit([Bind(Include = "Id,ClassName,StudentId")] Grade grade) { if (ModelState.IsValid) { db.Entry(grade).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.StudentId = new SelectList(db.Students, "Id", "Name", grade.StudentId); return(View(grade)); }