public ActionResult Create(Mark mark, int studentId) { mark.StudentId = studentId; db.Marks.Add(mark); db.SaveChanges(); return RedirectToAction("List", new { id = studentId }); }
public ActionResult Edit(Mark mark, int studentId) { mark.StudentId = studentId; db.Entry(mark).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("List", new { id = studentId }); }