public IQueryable <TeamLeague> GetTeamLeaguesForSeason(int seasonId) //string orderByProperty { return(from tl in teamLeagueRepository.Get() where tl.League.Season.Id == seasonId orderby tl.League.DivisionNo, tl.TeamName select tl); }
public IQueryable <Team> GetTeamsForLeague(int leagueId) { return(from t in teamLeagueRepository.Get() where t.League.Id == leagueId orderby t.TeamName select t.Team); }
public TeamLeague UpdateTeamLeaguePenaltyPoints(int leagueId, int teamId) { TeamLeague teamLeague = null; IQueryable <Penalty> teamPenalty = penaltyRepository.GetByTeamAndLeagueId(teamId, leagueId); int points = 0; if (teamPenalty.Count() > 0) { points = teamPenalty.Sum(p => p.Points); } // Get the associated team league and update the penalty points // This is a bit dodge teamLeague = (teamLeagueRepository.Get(x => (x.League.Id == leagueId && x.Team.Id == teamId))).First(); if (teamLeague != null) { teamLeague.PointsPenalty = points; } return(teamLeague); }
public TeamLeague GetTeamLeague(int id) { return(teamLeagueRepository.Get(id)); }
public int GetTotalWins(int teamId) { return((from tl in teamLeagueRepository.Get() where tl.Team.Id == teamId select tl.GamesWonTotal).Sum()); }