public ActionResult Edit(RestaurantWeb toEdit) { if (ModelState.IsValid) { restaurantRepo.UpdateRestaurant(toEdit.ToLibLayer()); return(RedirectToAction("Index")); } return(View(toEdit)); }
public ActionResult Create(RestaurantWeb newRest) { try { if (ModelState.IsValid) { restaurantRepo.CreateRestaurant(newRest.ToLibLayer()); return(RedirectToAction("Index")); } else { return(View(newRest)); } } catch { return(View()); } }
// GET: Restaurants/Edit/5 public ActionResult Edit(int id) { RestaurantWeb toEdit = restaurantsWeb.GetById(id); return(View(toEdit)); }