Esempio n. 1
0
        public IActionResult Delete(int id)
        {
            productContainer.Delete(id);

            List <ProductViewModel> productViews = ProductMapper.AllProductViewModels();

            return(RedirectToAction("Index", productViews));
        }
Esempio n. 2
0
        public IActionResult Create(ProductViewModel productModel)
        {
            Product newProduct = ProductMapper.Product(productModel);

            productContainer.AddNew(newProduct);

            List <ProductViewModel> productViews = ProductMapper.AllProductViewModels();

            return(RedirectToAction("Index", productViews));
        }
Esempio n. 3
0
        public IActionResult Index()
        {
            List <ProductViewModel> productViews = ProductMapper.AllProductViewModels();

            return(View(productViews));
        }