public ActionResult Edit([FromRoute] int id, [Bind("Name")] Restaurant restaurant) { try { if (ModelState.IsValid) { var libRest = new Lib.Restaurant { Id = id, Name = restaurant.Name }; Repo.UpdateRestaurant(libRest); Repo.Save(); return(RedirectToAction(nameof(Index))); } return(View(restaurant)); } catch (Exception ex) { return(View(restaurant)); } }
public void UpdateRestaurant(Models.Restaurant restaurant) { var rest = LibraryToDataRestaurant(restaurant); crud.UpdateRestaurant(rest); }