예제 #1
0
        public ActionResult Create(Mark mark, int studentId)
        {
            mark.StudentId = studentId;

            db.Marks.Add(mark);
            db.SaveChanges();
            return RedirectToAction("List", new { id = studentId });
        }
예제 #2
0
        public ActionResult Edit(Mark mark, int studentId)
        {
            mark.StudentId = studentId;

            db.Entry(mark).State = EntityState.Modified;
            db.SaveChanges();
            return RedirectToAction("List", new { id = studentId });
        }