Exemple #1
0
        public void Handle(PlayerRenamedEvent e)
        {
            var dto = QueryDataStore.GetData <GetGameResultsDto>().Single(x => x.GameId == e.AggregateId);

            var renamedPlayer = dto.Players.First(p => p.PlayerName == e.OldPlayerName);

            renamedPlayer.PlayerName = e.NewPlayerName;

            QueryDataStore.SaveChanges();
        }
        public void Handle(PlayerRenamedEvent e)
        {
            var players = QueryDataStore.GetData <GetPlayerGamesDto>().Where(x => x.PlayerName == e.OldPlayerName).ToList();

            foreach (var p in players)
            {
                p.PlayerName = e.NewPlayerName;
            }

            QueryDataStore.SaveChanges();
        }
Exemple #3
0
        public void Handle(PlayerRenamedEvent e)
        {
            var games = QueryDataStore.GetData <GetGamesListDto>().Where(x => x.Winner == e.OldPlayerName);

            foreach (var g in games)
            {
                g.Winner = e.NewPlayerName;
            }

            QueryDataStore.SaveChanges();
        }
 private void ApplyEvent(PlayerRenamedEvent e)
 {
     _players.Single(p => p.PlayerName == e.OldPlayerName).PlayerName = e.NewPlayerName;
 }