public static void DeletePlayerFromTeam() { var context = new GamepediaContext(); var teamplayer = context.TeamPlayers .Where(tp => tp.PlayerId == 4 && tp.TeamId == 2) .FirstOrDefault(); context.Remove(teamplayer); context.SaveChanges(); }
public static void DeleteTournamentByCountryId() { var context = new GamepediaContext(); var tournament = context.Tournaments .Where(t => t.CountryId == 2) .FirstOrDefault(); context.Remove(tournament); context.SaveChanges(); }