Exemplo n.º 1
0
 public ViewResult Index(int?id)
 {
     ViewBag.Categories = _catRepo.AllIncluding(category => category.Products);
     if (id == null || id == 0)
     {
         return(View(_prodRepo.AllIncluding(product => product.Categ)));
     }
     else
     {
         return(View(_prodRepo.All.Where(product => product.CategoryID == id)));
     }
 }
Exemplo n.º 2
0
 public ViewResult Index()
 {
     return(View(_catRepo.AllIncluding(cat => cat.Products)));
 }