public void ChangeName(int therapistId, string newName) { var foundTherapist = _db.Therapists.FirstOrDefault(o => o.Id == therapistId); foundTherapist.Name = newName; _db.Entry(foundTherapist).State = System.Data.Entity.EntityState.Modified; _db.SaveChanges(); }
public void ChangeAge(int clientId, int newAge) { var foundClient = _db.Clients.FirstOrDefault(o => o.Id == clientId); foundClient.Age = newAge; _db.Entry(foundClient).State = System.Data.Entity.EntityState.Modified; _db.SaveChanges(); }