Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }