public bool Update(Team teamToBeUpdated) { bool isUpdated = false; try { _db.Entry(teamToBeUpdated).State = EntityState.Modified; _db.SaveChanges(); isUpdated = true; } catch (Exception ex) { throw ex; } return(isUpdated); }
public bool Update(Player playerToBeUpdated) { bool isUpdated = false; try { _db.Entry(playerToBeUpdated).State = EntityState.Modified; _db.SaveChanges(); //var modifiedCount = _db.SaveChanges(); //if (modifiedCount > 0) isUpdated = true; } catch (Exception ex) { throw ex; } return(isUpdated); }