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 void ShouldDelegateFindByIdToTheWrapper() { var placeId = "42"; var expectedPlace = new Place(); _mongoDB.Setup(it => it.FindById <Place>("places", placeId)).Returns(expectedPlace); var actualPlace = _allPlaces.FindById(placeId); Assert.That(actualPlace, Is.SameAs(expectedPlace)); }
public ActionResult Place(string id) { var place = _allPlaces.FindById(id); return(View(place)); }