public virtual TEntity Update(TEntity entity) { dbSet.Attach(entity); context.Entry(entity).State = EntityState.Modified; context.SaveChanges(); return(entity); }
public virtual int Update <T>(T TObject) where T : class { var entry = dbContext.Entry(TObject); dbContext.Set <T>().Attach(TObject); entry.State = EntityState.Modified; return(dbContext.SaveChanges()); }
public void Update(T entity) { //table.Attach(entity); db.Entry(entity).State = EntityState.Modified; db.SaveChanges(); }