public async Task <IActionResult> InsertInstructor(InstructorDTO instructorDTO) { var instructor = _mapper.Map <Instructor>(instructorDTO); await _instructorService.InsertInstructor(instructor); instructorDTO = _mapper.Map <InstructorDTO>(instructor); var response = new APIResponse <InstructorDTO>(instructorDTO); return(Ok(response)); }
public IActionResult AddCourse(Instructor instructor) { try { _instructorService.InsertInstructor(instructor); ViewData["Message"] = "Successfully inserted"; return(View("Message")); } catch (Exception e) { ViewData["Message"] = e.Message; return(View("Message")); } }