Ejemplo n.º 1
0
        public Game GetGame(int gameId, bool populateTeams)
        {
            var thisGame = CBO.FillObject <Game>(DataProvider.Instance().GetGame(gameId));

            if (thisGame != null)
            {
                if (populateTeams)
                {
                    var tc = new TeamController();
                    foreach (Team t in tc.GetTeamsByGame(thisGame.GameId))
                    {
                        thisGame.Teams.Add(t);
                    }
                }
            }
            return(thisGame);
        }
Ejemplo n.º 2
0
        ///<summary>Take a list of Games and populate the Teams
        ///</summary>
        private static List <Game> PopulateTeamsForGame(IEnumerable <Game> games)
        {
            var outputGames = new List <Game>();

            foreach (var log in games)
            {
                //get the teams
                var tc = new TeamController();
                foreach (Team t in tc.GetTeamsByGame(log.GameId))
                {
                    log.Teams.Add(t);
                }
                outputGames.Add(log);
                //get the players
            }

            return(outputGames);
        }