public IActionResult Create(CreateStudentView createStudentView)
 {
     if (ModelState.IsValid)
     {
         Student student = new Student()
         {
             ClassRoomId = createStudentView.ClassRoomId,
             FullName    = createStudentView.FullName,
             DoB         = createStudentView.DoB,
             Email       = createStudentView.Email,
             Gender      = createStudentView.Gender
         };
         if (studentRepository.CreateStudent(student) > 0)
         {
             var ModelForWatchStudentsByClassIdView = classRoomRepository.GetStudentViewById(student.ClassRoomId);
             return(View("Views/ClassRoom/WatchStudentsByClassId.cshtml", ModelForWatchStudentsByClassIdView));
         }
     }
     return(View(createStudentView));
 }
Beispiel #2
0
 public IActionResult WatchStudentsByClassId(int id) => View(classRoomRepository.GetStudentViewById(id));