Ejemplo n.º 1
0
 public ActionResult Edit(int id)
 {
     try
     {
         Product p = context.FindById(id);
         if (p == null)
         {
             return(HttpNotFound());
         }
         else
         {
             ProductCategoryViewModel viewModel = new ProductCategoryViewModel();
             viewModel.Product           = p;
             viewModel.ProductCategories = contextCategory.Collection();
             return(View(viewModel));
         }
     }
     catch (Exception)
     {
         return(HttpNotFound());
     }
 }