public virtual void Delete(TEntity entityToDelete) { if (_context.Entry(entityToDelete).State == EntityState.Detached) { _dbSet.Attach(entityToDelete); } _dbSet.Remove(entityToDelete); }
public void UpdateUser(SysUser user) { context.Entry(user).State = EntityState.Modified; }