Example #1
0
        public void WhenSavingItShouldDelegateToMongoAbstraction()
        {
            var place = new Place("fooBarBazQuux");

            _allPlaces.Save(place);

            _mongoDB.Verify(it => it.Save("places", place));
        }
Example #2
0
        public ActionResult AddMenuItem(string placeId, MenuItem menuItem)
        {
            var place = _allPlaces.FindById(placeId);

            place.Menu.Items.Add(menuItem);
            _allPlaces.Save(place);
            return(RedirectToAction("place", "places", new { id = placeId }));
        }
Example #3
0
 public ActionResult Create(Place place)
 {
     _allPlaces.Save(place);
     return(RedirectToAction("index", "places"));
 }