public ActionResult Edit(TeamViewModel viewModel) { if (ModelState.IsValid) { var team = Mapper.Map<Team>(viewModel); RavenSession.Store(team); return RedirectToAction("Index"); } return View(viewModel); }
public ActionResult Create(TeamViewModel viewModel) { if (ModelState.IsValid) { var team = Mapper.Map<Team>(viewModel); // set the id to be the object/ to allow for incrementing id RavenSession.Store(team, "teams/"); return RedirectToAction("Index"); } return View(viewModel); }