public async Task <ActionResult> Put([FromBody] UpdateSchoolDTO schoolDTO) { if (!ModelState.IsValid) { return(BadRequest()); } var schoold = await _schoolService.GetAsync(schoolDTO.Id); if (schoold != null) { await _schoolService.UpdateAsync(schoolDTO); return(NoContent()); } return(NotFound()); }
public async Task UpdateAsync(UpdateSchoolDTO schoolDto) { var school = _mapper.Map <Domain.School>(schoolDto); await _repository.UpdateAsync(school); }