private void CreateNewProduct(Product product) { Product newProduct = productsService.CreateNewProduct(product); if (newProduct != null) { Products.Add(newProduct); } }
public ActionResult Add(ProductBindingModel model) { if (model != null && ModelState.IsValid) { service.CreateNewProduct(model); return(RedirectToAction("All", "Products", routeValues: new { area = "" })); } return(this.View()); }