public void Update(T entity) { if (entity == null) { throw new ArgumentNullException("entity"); } Dbset.Attach(entity); Context.Entry(entity).State = EntityState.Modified; }
public bool Update(Complemento o) { try { using (var db = new SyncContext()) { db.Entry(o).State = EntityState.Modified; db.SaveChanges(); return(true); } } catch (Exception ex) { Ambiente.Message("Algo salío mal con: " + MethodBase.GetCurrentMethod().Name + " @" + GetType().Name + "\n" + ex.Message); } return(false); }