コード例 #1
0
        public async Task <IActionResult> Create([FromBody] CreateProductTypeRequest productTypeRequest)
        {
            var productType = new ProductType {
                Type = productTypeRequest.TypeName
            };

            await _productTypeService.CreateProductTypeAsync(productType);

            var locationUrl = _uriService.GetProductTypeUri(productType.Id.ToString());

            //var response = new ProductTypeResponse { Id = productType.Id };
            return(Created(locationUrl, _mapper.Map <ProductTypeResponse>(productType)));
        }