public static NewGameData Convert(NewGameInput newGameInput) { var newGameData = new NewGameData(newGameInput.Name, newGameInput.Totem.Value, newGameInput.Opponent1, newGameInput.Opponent2, newGameInput.Opponent3); return newGameData; }
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()); }