public ReporteGoles GetGameReport(Guid id)
        {
            //  var game = _gamesRepository.GetGame(id);
            //var gameReport = _gameToGameReportMapper.Map(game);
            ReporteGoles reporteGoles = _gamesRepository.GetReporteGoles(id);

            return(reporteGoles);
        }
        public void AddReporteGoles(Game game, ReporteGoles reporteGoles)
        {
            //
            //GameToGameReportMapper mapeador = new GameToGameReportMapper();
            //GameReport repor = mapeador.Map(game);
            //  reporteGoles = new ReporteGoles(repor);
            baseReporteGoles.Add(game.Id, reporteGoles);

            //
        }
        public void AddGoal(Guid id, NewGoal newGoal)
        {
            var game = _gamesRepository.GetGame(id);//obtenemos el partido mediante la id


            GameToGameReportMapper mapeador     = new GameToGameReportMapper();
            GameReport             report       = mapeador.Map(game);
            ReporteGoles           reporteGoles = new ReporteGoles(report);



            var currentDate = _dateTimeService.GetUtcNow();     //establecemos la fecha actual del partido

            var teamCode = newGoal.TeamCode;                    //obtenemos el nombre del equipo

            var goal = new Goal(currentDate, newGoal.ScoredBy); //creamos un goal con la fecha actual del gol
            //, y scoreby quien marco (nombre del jugador)

            var isTeamPlaying = game.LocalTeamCode == teamCode || game.ForeignTeamCode == teamCode;


            if (!isTeamPlaying)//si no esta jugando
            {
                throw new ResourceNotFoundException($"The team code {teamCode} is not playing the game");
            }

            if (game.LocalTeamCode == teamCode) //si el juego el quipoLocal  es igual al teamcode
            {
                game.AddLocalTeamGoal(goal);    //agregamos al juego los goal que han marcado si pertenece a ese equipo
                                                //
                reporteGoles.añadirGoles(newGoal, goal);
            }
            else
            {
                game.AddForeignTeamGoal(goal);//se lo metemos al equipo adversario

                reporteGoles.añadirGoles(newGoal, goal);
            }

            _gamesRepository.UpdateGame(id, game);//actualizamos la base de datos con la id y game

            //actualizamos el reporte de la clase pivote

            mapeador = new GameToGameReportMapper();
            Game       juegoFinal   = _gamesRepository.GetGame(id);
            GameReport reporteFinal = mapeador.Map(juegoFinal);

            reporteGoles = new ReporteGoles(report);

            _gamesRepository.AddReporteGoles(juegoFinal, reporteGoles);
            //
        }