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