Example #1
0
 public ActionResult Edit(Vehicle vehicle)
 {
     if (ModelState.IsValid)
     {
         db.Entry(vehicle).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", new { id = vehicle.CategoryId }));
     }
     return(View(vehicle));
 }
 public ActionResult Edit(Category category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(category));
 }