If the purpose of the solenoid is instead to impede changes in the electric current, a solenoid can be more specifically classified as an inductor rather than an electromagnet. The coil will generate a magnetic field when current passes through it.
eBay