コード例 #1
0
        private void CreateNewProduct(Product product)
        {
            Product newProduct = productsService.CreateNewProduct(product);

            if (newProduct != null)
            {
                Products.Add(newProduct);
            }
        }
コード例 #2
0
        public ActionResult Add(ProductBindingModel model)
        {
            if (model != null && ModelState.IsValid)
            {
                service.CreateNewProduct(model);

                return(RedirectToAction("All", "Products", routeValues: new { area = "" }));
            }

            return(this.View());
        }