public virtual void Delete(TEntity entityToDelete) { if (context.Entry(entityToDelete).State == EntityState.Detached) { dbSet.Attach(entityToDelete); } dbSet.Remove(entityToDelete); }
public virtual TEntity Atualizar(TEntity obj) { var entry = Db.Entry(obj); DbSet.Attach(obj); entry.State = EntityState.Modified; return(obj); }