Exemple #1
0
 public ActionResult Create()
 {
     var model = new PartyModel { Id = Guid.NewGuid() };
     //model.Players = PlayerService.GetPlayerUsers().Select(x => new UIPlayerModel { Id = Guid.NewGuid(), User = AutoMapper.Mapper.Map<IUser, GameCenterCore.User>(x.User), Nick = x.Nick }).ToList();
     model.Players = PlayerService.GetPlayerUsers().Select(x => new UIPlayerModel { Id = Guid.NewGuid(), UserId = x.UserId, Nick = x.Nick }).ToList();
     return View(model);
 }
Exemple #2
0
 public ActionResult Save(PartyModel model)
 {
     if (ModelState.IsValid)
     {
         IParty party = model.ToParty();
         PartyService.Save(party);
         return RedirectToAction("Index");
     }
     //model.Players = PlayerService.GetPlayerUsers().Select(x => new UIPlayerModel { Id = x.Id, User = AutoMapper.Mapper.Map<GameCenterCore.User>(x.User), Nick = x.Nick }).ToList();
     model.Players = PlayerService.GetPlayerUsers().Select(x => new UIPlayerModel { Id = x.Id, UserId = x.UserId, Nick = x.Nick }).ToList();
     return View("Create", model);
 }