Exemplo n.º 1
0
        public static NewGameData Convert(NewGameInput newGameInput)
        {
            var newGameData = new NewGameData(newGameInput.Name, newGameInput.Totem.Value, newGameInput.Opponent1, newGameInput.Opponent2,
            newGameInput.Opponent3);

              return newGameData;
        }
Exemplo n.º 2
0
    public async Task<ActionResult> Index(NewGameInput newGameInput)
    {
      if (!ModelState.IsValid)
      {
        return View(newGameInput);
      }

      var newGameData = NewGameConverter.Convert(newGameInput);
      var username = Guid.NewGuid().ToString("D");
      CreateUserCommand.Execute(HttpContext, username);
      CreateGameCommand.Execute(username, newGameData);

      return this.RedirectToAction<HomeController>(x => x.Index());
    }