private Restaurant BuildRestaurantAndReviews(params int[] ratings) { var restaurant = new Restaurant(); // need a using statement for System.Linq at the top of the file restaurant.Reviews = ratings.Select(r => new RestaurantReview { Rating = r }) .ToList(); return restaurant; }
public ActionResult Create(Restaurant restaurant) { if (ModelState.IsValid) { _db.Add(restaurant); _db.SaveChanges(); return RedirectToAction("Index"); } return View(restaurant); }
public RestaurantRater(Restaurant restaurant) { // TODO: Complete member initialization this._restaurant = restaurant; }