コード例 #1
0
 public ActionResult Create(Restaurant restaurant)
 {
     if (!ModelState.IsValid)
     {
         return View(restaurant);
     }
     restaurantService.CreateRestaurant(restaurant);
     return RedirectToAction("Index");
 }
コード例 #2
0
ファイル: RestaurantViewModel.cs プロジェクト: StoneC/NoTweak
 public RestaurantViewModel(Restaurant restaurant, IList<Dish> dishes)
 {
     Restaurant = restaurant;
     Dishes = dishes;
 }
コード例 #3
0
 //
 // GET: /Restaurant/Create
 public ActionResult Create()
 {
     Restaurant restautant = new Restaurant();
     return View(restautant);
 }
コード例 #4
0
ファイル: RestaurantService.cs プロジェクト: StoneC/NoTweak
 public void CreateRestaurant(Restaurant Restaurant)
 {
     RestaurantRepository.Add(Restaurant);
     unitOfWork.Commit();
 }