public Team[] Execute(Guid gameId)
 {
     Team[] teams = null;
     _sqlCommand.Execute(db =>
                         teams = (from gt in db.GameTeams
                                  join t in db.Teams on gt.TeamId equals t.Id
                                  where gt.GameId == gameId
                                  select _mapper.Map <Team>(t)).ToArray()
                         );
     return(teams);
 }
        public GameTeamStatistics[] Execute(Guid gameId)
        {
            GameTeamStatistics[] statistics = null;
            _sqlCommand.Execute(db => statistics =
                                    (from gt in db.GameTeams
                                     .Include(x => x.DecimalStatistics)
                                     .Include(x => x.IntegerStatistics)
                                     .Include(x => x.TimeStatistics)
                                     where gt.GameId == gameId
                                     select _mapper.Map <GameTeamStatistics>(gt)).ToArray()
                                );

            return(statistics);
        }
        public League[] Execute(Guid playerId)
        {
            var leagues = new List <League>();

            _sqlCommand.Execute(db =>
                                leagues = (from l in db.Leagues
                                           join s in db.Seasons on l.Id equals s.LeagueId
                                           join st in db.SeasonTeams on s.Id equals st.SeasonId
                                           join t in db.Teams on st.TeamId equals t.Id
                                           join tp in db.TeamPlayers on t.Id equals tp.TeamId
                                           where tp.PlayerId == playerId
                                           select _mapper.Map <League>(l)).ToList()
                                );

            return(leagues.ToArray());
        }