Example #1
0
 public ActionResult Create(InstructorCreateViewModel viewModel)
 {
     try
     {
         InstructorRepository.CreateInstructor(viewModel);
         return(View(viewModel));
     }
     catch
     {
         return(View());
     }
 }
Example #2
0
        public ActionResult Create([FromForm] InstructorCreateViewModel model)
        {
            var instructor = InstructorRepository.CreateInstructor(model.instructor);

            return(RedirectToAction(nameof(Index)));
        }
        public ActionResult Create([FromForm] InstructorCreateViewModel model)
        {
            var instructor = InstructorRepository.CreateInstructor(model.Instructor);

            return(View(model));
        }