Exemplo n.º 1
0
 public void GetSeasonGamesTest()
 {
     using (var db = new CSBCDbContext())
     {
         var rep = new ScheduleGameRepository(db);
         var games = rep.GetSeasonGames(757);
         Assert.IsTrue(games.Any());
     }
 }
Exemplo n.º 2
0
 public List<ScheduleStandingsViewModel> GetStandings(int divisionNo)
 {
     //var sql = "Exec GetStanding @ScheduleNumber = " + divisionNo.ToString();
     //DataTable whatIsThis = db.ExecuteGetSQL(sql);
     using (var db = new CSBCDbContext())
     {
         var rep = new ScheduleGameRepository(db); //make this a method here....
         var games = rep.GetSeasonGames(divisionNo).ToList<ScheduleGame>();
         var teams = GetDivisionTeams(divisionNo);
         var teamRecords = GetTeamRecords(teams, games);
         return teamRecords.OrderByDescending(t => t.Pct).ThenByDescending(t => t.Won).ToList();
     }
 }