Of course you can use dimethylamine in an unreactive solvent instead of pure dimethylamine (which by the way has a rather low boiling point - 7.4°C). Just make sure you choose a solvent compatible with the reaction you have in mind. Diethyl ether is a good solvent for diethylamine, as is THF.