public ActionResult Delete(RestaurantsDeleteViewModel model) { RestaurantRepository repository = new RestaurantRepository(); repository.Delete(model.ID); return(RedirectToAction("Index")); }
public ActionResult Delete(int id) { RestaurantRepository repository = new RestaurantRepository(); Restaurant restaurant = repository.GetByID(id); RestaurantsDeleteViewModel model = new RestaurantsDeleteViewModel(); model.ID = restaurant.ID; model.Name = restaurant.Name; model.Address = restaurant.Address; model.Phone = restaurant.Phone; model.Capacity = restaurant.Capacity; model.OpenHour = restaurant.OpenHour; model.CloseHour = restaurant.CloseHour; return(View(model)); }