public ActionResult IndexProducts(int?categoryId) { Logica.BL.Categories categories = new Logica.BL.Categories(); var listCategories = (from q in categories.GetCategories() select new Logica.Models.ViewModels.CategoriesIndexViewModel { Id = q.Id, Name = q.Name, Active = q.Active }).ToList(); return(View(listCategories)); }
// GET: Categories public ActionResult Index() { Logica.BL.Categories categories = new Logica.BL.Categories(); var listCategories = (from q in categories.GetCategories() select new Logica.Models.ViewModels.CategoriesIndexViewModel { Id = q.Id, Name = q.Name, Active = q.Active }).ToList(); return(RedirectToAction("IndexProducts")); }