コード例 #1
0
        public IActionResult DeleteProductFeature(int productId, int id)
        {
            if (!_productInfoRepository.ProductExists(productId))
            {
                return(NotFound());
            }

            var productFeatureToDelete = _productInfoRepository.GetProductFeature(productId, id);

            if (null == productFeatureToDelete)
            {
                return(NotFound());
            }

            _productInfoRepository.DeleteFeature(productFeatureToDelete);


            if (!_productInfoRepository.Save())
            {
                return(StatusCode(500, "A problem happened while handling your request."));
            }

            return(NoContent());
        }