public CreateGameResult Execute(CreateGame createGame) { var id = Guid.NewGuid(); var game = new Game(id); foreach (var playerName in createGame.PlayerNames) game.Players.Add(new Player(playerName)); repository.Insert(game); return new CreateGameResult(id); }
public CreateGameResult Execute(CreateGame createGame) { var id = Guid.NewGuid(); var game = new Game(id); foreach (var playerName in createGame.PlayerNames) { game.Players.Add(new Player(playerName)); } repository.Insert(game); return(new CreateGameResult(id)); }