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);
 }
Beispiel #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);
 }
Beispiel #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);
 }
Beispiel #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);
 }