Esempio n. 1
0
        public async Task <ActionResult> UpdateRobotTypeAsync(int id, [FromBody] UpdateRobotTypeDto robotType)
        {
            robotType.Id = id;
            var type = await _robotTypeService.UpdateRobotTypeAsync(robotType);

            return(Json(JsonResultData.Success(type)));
        }
Esempio n. 2
0
        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));
        }