// private bool atualizar(Atendimento OAtendimento) { OAtendimento.setDefaultUpdateValues(); Atendimento dbAtendimento = this.carregar(OAtendimento.id); if (dbAtendimento == null) { return(false); } var dbEntry = db.Entry(dbAtendimento); dbEntry.CurrentValues.SetValues(OAtendimento); dbEntry.ignoreFields(); db.SaveChanges(); return(OAtendimento.id > 0); }