Exemplo n.º 1
0
 public void AddChamp(Championship champToBeAdded)
 {
     using (MNSportsTeamContext context = new MNSportsTeamContext())
     {
         context.Championships.Add(champToBeAdded);
         context.SaveChanges();
     }
 }
Exemplo n.º 2
0
 public void AddVenue(Venue venueToBeAdded)
 {
     using (MNSportsTeamContext context = new MNSportsTeamContext())
     {
         context.Venues.Add(venueToBeAdded);
         context.SaveChanges();
     }
 }
Exemplo n.º 3
0
 public void AddYear(Year yearToBeAdded)
 {
     using (MNSportsTeamContext context = new MNSportsTeamContext())
     {
         context.Years.Add(yearToBeAdded);
         context.SaveChanges();
     }
 }
Exemplo n.º 4
0
 public void AddTeam(Team teamToBeAdded)
 {
     using (MNSportsTeamContext context = new MNSportsTeamContext())
     {
         context.Teams.Add(teamToBeAdded);
         context.SaveChanges();
     }
 }
Exemplo n.º 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();
     }
 }