public ActionResult Edit(int idR) { Console.WriteLine(idR); RestaurantV thisRestaurant = _db.Restaurants.FirstOrDefault(rest => rest.RestaurantVId == idR); Console.WriteLine(thisRestaurant.Name); ViewBag.CuisineId = new SelectList(_db.Cuisines, "CuisineId", "Name"); return(View(thisRestaurant)); }
public ActionResult Edit(RestaurantV restaurant) { // _db.Update(restaurant); Console.WriteLine(restaurant.CuisineId); Console.WriteLine(restaurant.RestaurantVId); _db.Entry(restaurant).State = EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Details(int idR) { RestaurantV thisRestaurant = _db.Restaurants.FirstOrDefault(restaurants => restaurants.RestaurantVId == idR); return(View(thisRestaurant)); }
public ActionResult Create(RestaurantV restaurant) { _db.Restaurants.Add(restaurant); _db.SaveChanges(); return(RedirectToAction("Index")); }