public async Task <ActionResult> UpdateRobotTypeAsync(int id, [FromBody] UpdateRobotTypeDto robotType) { robotType.Id = id; var type = await _robotTypeService.UpdateRobotTypeAsync(robotType); return(Json(JsonResultData.Success(type))); }
public async Task <GetRobotTypeDto> UpdateRobotTypeAsync(UpdateRobotTypeDto item, CancellationToken ct = default) { var itemToUpdate = _mapper.Map <RobotType>(item); _unitOfWork.RobotTypeRepository.Update(itemToUpdate); await _unitOfWork.CommitAsync(ct); return(_mapper.Map <GetRobotTypeDto>(itemToUpdate)); }