Exemplo n.º 1
0
        public ActionResult AddStudent(StudentPostDto student)
        {
            var studentModel = new Student
            {
                Name            = student.Name,
                Email           = student.Email,
                Contact         = student.Contact,
                Password        = student.Password,
                ConfirmPassword = student.ConfirmPassword
            };
            var id        = studentrepo.AddStudentByStoredProcedure(studentModel);
            int studentId = Convert.ToInt32(id);

            studentrepo.AddStudentCoursesBySp(studentId, student.CoursesList);
            return(RedirectToAction("StudentList"));
        }