A solution phase fabrication of magnetic nanoparticles encapsulated in carbon