public bool Atualizar(Organismo organismo) { using (var ctx = new CippContexto()) { try { ctx.Entry(organismo).State = EntityState.Modified; var resultado = ctx.SaveChanges(); if (resultado <= 0) { return(false); } return(true); } catch { throw; } } }
public bool Atualizar(IntegracaoInfos obj) { try { using (var context = new CippContexto()) { context.Entry(obj).State = obj.Id == 0 ? EntityState.Added : EntityState.Modified; var resultado = context.SaveChanges(); if (resultado <= 0) { return(false); } return(true); } } catch (Exception e) { throw e; } }