예제 #1
0
 public Player UpdatePlayer(Player thisPlayer)
 {
     if (_context.Players.Find(thisPlayer.Id) != null)
     {
         var updatedPlayer = _context.Players.Attach(thisPlayer);
         updatedPlayer.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
         _context.SaveChanges();
         return(thisPlayer);
     }
     return(thisPlayer);
 }
예제 #2
0
 public Match UpdateMatch(Match thisMatch)
 {
     if (_context.Matches.Find(thisMatch.Id) != null)
     {
         var updatedMatch = _context.Matches.Attach(thisMatch);
         updatedMatch.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
         _context.SaveChanges();
         return(thisMatch);
     }
     return(thisMatch);
 }
예제 #3
0
 public Team UpdateTeam(Team thisTeam)
 {
     if (_context.Teams.Find(thisTeam.Id) != null)
     {
         var updatedTeam = _context.Teams.Attach(thisTeam);
         updatedTeam.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
         _context.SaveChanges();
         return(thisTeam);
     }
     return(thisTeam);
 }
 public PlayerMatchTime UpdateMatch(PlayerMatchTime thisPlayerMatchTime)
 {
     if (_context.Matches.Find(thisPlayerMatchTime.Id) != null)
     {
         var updatedPlayerMatchTime = _context.Player_Match_Time.Attach(thisPlayerMatchTime);
         updatedPlayerMatchTime.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
         _context.SaveChanges();
         return(thisPlayerMatchTime);
     }
     return(thisPlayerMatchTime);
 }
예제 #5
0
 public MatchGoal EditMatchGoal(MatchGoal thisMatchGoal)
 {
     if (_context.Match_Goals.Find(thisMatchGoal.Id) != null)
     {
         var updatedMatchGoal = _context.Match_Goals.Attach(thisMatchGoal);
         updatedMatchGoal.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
         _context.SaveChanges();
         return(thisMatchGoal);
     }
     return(thisMatchGoal);
 }