public ActionResult Create(RestaurantCategory restaurantcategory) { if (ModelState.IsValid) { db.RestaurantCategories.Add(restaurantcategory); db.SaveChanges(); return RedirectToAction("Index"); } return View(restaurantcategory); }
public ActionResult Edit(RestaurantCategory restaurantcategory) { if (ModelState.IsValid) { db.Entry(restaurantcategory).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(restaurantcategory); }