public async Task <ActionResult <Instructor> > CreateInstructor([FromBody] InstructorViewModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { var created = await instructorService.CreateInstructorAsync(model); return(CreatedAtAction(nameof(GetInstructorById), new { instructorId = created.Id }, created)); } catch (Exception e) { return(await HandleControllerException(e)); } }