public async Task <GetRobotModelDto> CreateRobotModelAsync(CreateRobotModelDto item, CancellationToken ct = default) { var newItem = _mapper.Map <RobotModel>(item); _unitOfWork.RobotModelRepository.Create(newItem); await _unitOfWork.CommitAsync(ct); return(_mapper.Map <GetRobotModelDto>(newItem)); }
public async Task <ActionResult> CreateRobotModelAsync([FromBody] CreateRobotModelDto robotModel) { var model = await _robotModelService.CreateRobotModelAsync(robotModel); return(StatusCode((int)HttpStatusCode.Created, Json(JsonResultData.Success(model)))); }