public async Task <ActionResult> UpdateRobotCompanyAsync(int id, [FromBody] UpdateRobotCompanyDto robotCompany) { robotCompany.Id = id; var company = await _robotCompanyService.UpdateRobotCompanyAsync(robotCompany); return(Json(JsonResultData.Success(company))); }
public async Task <GetRobotCompanyDto> UpdateRobotCompanyAsync(UpdateRobotCompanyDto item, CancellationToken ct = default) { var itemToUpdate = _mapper.Map <RobotCompany>(item); _unitOfWork.RobotCompanyRepository.Update(itemToUpdate); await _unitOfWork.CommitAsync(ct); return(_mapper.Map <GetRobotCompanyDto>(itemToUpdate)); }