public ActionResult AddStudent(string studentName, int CourseID) { StudentCourse newPair = new StudentCourse(Student.FindByName(studentName).GetId(), CourseID); newPair.Save(); return(RedirectToAction("Detail", new { ID = CourseID })); }