Exemplo n.º 1
0
        // GET: Products
        public ActionResult Index(string category)
        {
            ViewBag.Categories = db.Categories.ToList();

            if (!string.IsNullOrEmpty(TempData["Message"] as string))
            {
                ViewBag.Message = TempData["Message"] as string;
                TempData.Remove("Message"); //Limpio el TempData Message.
            }
            var Products = RepositoryProduct.ListProductFromCategory(category);

            return(View(Products));
        }