public virtual void Delete(T entityToDelete) { if (_ctx.Entry(entityToDelete).State == EntityState.Detached) { _dbSet.Attach(entityToDelete); } _dbSet.Remove(entityToDelete); }
public void Update(User user) { _ctx.Entry(user).State = EntityState.Modified; }