public void TableChanged(int tableId, IPlayTableService playTableService) { var tablePlayers = playTableService.GetPlayersOfTable(tableId); var tableViewers = playTableService.GetTableViewer(tableId); var tableState = TableHubUtils.GetTableState(tableId, playTableService, _mapper); Parallel.ForEach(tablePlayers, (tablePlayer) => { var clientUser = getClientUser(tablePlayer.PlayerId); if (clientUser != null) { clientUser.PlayerTableState(tableState); } }); // for all viewers of the table Parallel.ForEach(tableViewers, (tableViewer) => { var clientUser = getClientUser(tableViewer.userId); if (clientUser != null) { clientUser.SpectatorTable(tableState); } }); }