Пример #1
0
 public void AddChamp(Championship champToBeAdded)
 {
     using (MNSportsTeamContext context = new MNSportsTeamContext())
     {
         context.Championships.Add(champToBeAdded);
         context.SaveChanges();
     }
 }
Пример #2
0
 public void AddVenue(Venue venueToBeAdded)
 {
     using (MNSportsTeamContext context = new MNSportsTeamContext())
     {
         context.Venues.Add(venueToBeAdded);
         context.SaveChanges();
     }
 }
Пример #3
0
 public void AddYear(Year yearToBeAdded)
 {
     using (MNSportsTeamContext context = new MNSportsTeamContext())
     {
         context.Years.Add(yearToBeAdded);
         context.SaveChanges();
     }
 }
Пример #4
0
 public void AddTeam(Team teamToBeAdded)
 {
     using (MNSportsTeamContext context = new MNSportsTeamContext())
     {
         context.Teams.Add(teamToBeAdded);
         context.SaveChanges();
     }
 }
Пример #5
0
 public void DeleteTeamByName(string teamName)
 {
     using (MNSportsTeamContext context = new MNSportsTeamContext())
     {
         var teamToDelete = context.Teams.SingleOrDefault(n => n.Name == teamName);
         context.Teams.Remove(teamToDelete);
         context.SaveChanges();
     }
 }