public ActionResult AddAssignment(Assignment newAssignment) { if (ModelState.IsValid) { var database = new CourseRepository(); database.AddAssignmentToCourse(newAssignment); return(RedirectToAction("Gradebook", new { id = newAssignment.CourseId })); } return(View("AddAssignment", newAssignment)); }