コード例 #1
0
        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());
        }
コード例 #2
0
 public async Task UpdateAsync(UpdateSchoolDTO schoolDto)
 {
     var school = _mapper.Map <Domain.School>(schoolDto);
     await _repository.UpdateAsync(school);
 }