Exemplo n.º 1
0
        public ActionResult Create(Mark mark, int studentId)
        {
            mark.StudentId = studentId;

            db.Marks.Add(mark);
            db.SaveChanges();
            return RedirectToAction("List", new { id = studentId });
        }
Exemplo n.º 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 });
        }