public async Task <IActionResult> Put(long id, [FromBody] PetDto model) { if (!(await CheckPetExistsById(id))) { return(NotFound()); } if (model.Id == 0) { model.Id = id; } await _petsRepository.UpdatePetAsync(AutoMapper.Mapper.Map <Pet>(model)); return(Ok()); }