public void Get_Id_Success()
        {
            var fixture = fixtureRepository.Get(1);

            Assert.That(fixture, Is.Not.Null);
            Assert.That(fixture.HomeTeamLeague.Id, Is.EqualTo(1));
        }
Beispiel #2
0
        public int?GetFixtureIdForBiggestedHomeWinForTeam(int teamId)
        {
            // Select all the fixture id and winning margin for all winning home fixtures
            var homeWinsPointsDifference = from f in fixtureRepository.Get()
                                           where f.HomeTeamLeague.Team.Id == teamId &&
                                           f.HomeTeamScore > f.AwayTeamScore
                                           select new { f.Id, Diff = f.HomeTeamScore - f.AwayTeamScore };

            // Select the fixtureI of the fixture with the biggest margin
            return((from fixture in homeWinsPointsDifference
                    group fixture by new { fixture.Id, fixture.Diff } into grp
                    orderby grp.Key.Diff descending
                    select grp.Key.Id).Take(1).SingleOrDefault());
        }
Beispiel #3
0
 public IQueryable <Fixture> GetCupFixturesForSeason(int cupId, int seasonId)
 {
     return(from f in fixtureRepository.Get()
            where f.IsCupFixture && f.Cup.Id == cupId &&
            f.HomeTeamLeague.League.Season.Id == seasonId
            select f);
 }
 public List <Fixture> GetFixturesForTeamLeagues(List <int> teamLeagueIds)
 {
     return((from f in  fixtureRepository.Get()
             where teamLeagueIds.Contains(f.HomeTeamLeague.Id) ||
             teamLeagueIds.Contains(f.AwayTeamLeague.Id)
             select f).ToList());
 }
Beispiel #5
0
 public TFixture Get(int id)
 {
     return(FixtureRepository.Get <TFixture, TAvailableSources>(id));
 }
 public Fixture GetFixture(int id)
 {
     return(fixtureRepository.Get(id));
 }