public async Task <IActionResult> PostFaculty([FromBody] Faculty faculty) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } faculty = await _facultyService.AddAsync(faculty); return(Ok(faculty)); }
public async Task <IActionResult> AddAsync([FromBody] FacultyAddOrUpdateModel facultyAddOrUpdateModel) { if (!ModelState.IsValid) { BadRequest(); } var facultyCreateDto = _mapper.Map <FacultyCreateDto>(facultyAddOrUpdateModel); var statusCode = await _facultyService.AddAsync(facultyCreateDto); var response = _facultyResponseComposer.ComposeForCreate(statusCode, facultyCreateDto); return(response); }