public ActionResult Create(Restaurant restaurant) { if (!ModelState.IsValid) { return View(restaurant); } restaurantService.CreateRestaurant(restaurant); return RedirectToAction("Index"); }
public RestaurantViewModel(Restaurant restaurant, IList<Dish> dishes) { Restaurant = restaurant; Dishes = dishes; }
// // GET: /Restaurant/Create public ActionResult Create() { Restaurant restautant = new Restaurant(); return View(restautant); }
public void CreateRestaurant(Restaurant Restaurant) { RestaurantRepository.Add(Restaurant); unitOfWork.Commit(); }