public void eliminar() { try { using (var ctx = new tekusContext()) { ctx.Entry(this).State = EntityState.Deleted; ctx.SaveChanges(); } } catch (Exception E) { throw; } }
public void salvarCliente() { try { using (var ctx = new tekusContext()) { if (this.id > 0) { ctx.Entry(this).State = EntityState.Modified; } else { ctx.Entry(this).State = EntityState.Added; } ctx.SaveChanges(); } } catch (Exception E) { throw; } }