public ActionResult AddAssignment(Assignment model) { using (var db = new SWC_LMSEntities()) { db.Assignments.Add(model); db.SaveChanges(); } return RedirectToAction("CourseGradebook", "Teacher", new{courseId=model.CourseId}); }
public ActionResult AddAssignment(int courseId) { var viewModel = new Assignment {CourseId = courseId}; return View(viewModel); }