コード例 #1
0
        public IActionResult CreateProduct(ProductModel product)
        {
            var          name       = product.Name;
            var          category   = product.Category;
            var          price      = product.Price;
            var          image      = product.Image;
            ProductModel newProduct = Facade.CreateProduct(name, category, price, image);

            if (newProduct != null)
            {
                return(Ok(newProduct));
            }
            return(BadRequest());
        }