public void WhenSavingItShouldDelegateToMongoAbstraction() { var place = new Place("fooBarBazQuux"); _allPlaces.Save(place); _mongoDB.Verify(it => it.Save("places", place)); }
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 })); }
public ActionResult Create(Place place) { _allPlaces.Save(place); return(RedirectToAction("index", "places")); }