Exemplo n.º 1
0
 public ActionResult Edit(TeamViewModel viewModel)
 {
     if (ModelState.IsValid)
     {
         var team = Mapper.Map<Team>(viewModel);
         RavenSession.Store(team);
         return RedirectToAction("Index");
     }
     return View(viewModel);
 }
Exemplo n.º 2
0
 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);
 }