public async Task <GetRobotTypeDto> CreateRobotTypeAsync(CreateRobotTypeDto item, CancellationToken ct = default) { var newItem = _mapper.Map <RobotType>(item); _unitOfWork.RobotTypeRepository.Create(newItem); await _unitOfWork.CommitAsync(ct); return(_mapper.Map <GetRobotTypeDto>(newItem)); }
public async Task <ActionResult> CreateRobotTypeAsync([FromBody] CreateRobotTypeDto robotType) { var type = await _robotTypeService.CreateRobotTypeAsync(robotType); return(StatusCode((int)HttpStatusCode.Created, Json(JsonResultData.Success(type)))); }