That looks similar to the Tunze branded model 7077/2. Probably a OEM\Generic.
You can connect the solenoid to the regulator first (in fact, you should). The needle valve then goes after the solenoid.
I'm very much interested in why you say it should be mounted before needle valve. What are the con\pro's of mounting either way.
Inline it seems would be more convenient and easy to swap out, with little downtime should the solenoid need replacing. Especially for hobbyist that may not be so technically inclined.