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);
 }
Beispiel #2
0
        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));
        }