public IEnumerable <LeagueStats> Get(int leagueId) { //Get all of the teams for the league ID provided, so we can calculate the var teams = this.unitOfWork.Repository.GetQuery <Team>(x => x.LeagueId == leagueId) .Include(x => x.Scores).ToList(); //Calculate the league stats var league = new League(); return(league.CalculateLeagueStats(teams)); }