public void GetSponsorsInSeasonTest() { using (var db = new CSBCDbContext()) { var repProfile = new SponsorProfileRepository(db); var sponsors = repProfile.GetSponsorsInSeason(1, 9); Assert.IsTrue(sponsors.Any()); } }
private void GetSponsorsForSeason(int seasonId) { using (var db = new CSBCDbContext()) { try { var rep = new SponsorProfileRepository(db); List<SponsorProfile> sponsors; //if (String.IsNullOrEmpty(value)) sponsors = rep.GetSponsorsInSeason(Master.CompanyId, Master.SeasonId).ToList<SponsorProfile>(); //else // sponsors = rep.GetAll(Master.CompanyId).ToList<SponsorProfile>(); gridSponsorsInSeason.DataSource = sponsors; gridSponsorsInSeason.DataBind(); } catch (Exception ex) { lblError.Text = "GetData::" + ex.Message; } } }