I Have this code
var loader = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance<IContentLoader>();
I want to get the instance of IContentLoader using constructor injection.
If you're on a recent Episerver version (NuGet package EPiServer.ServiceLocation.StructureMap
> 2.0), you should be able to simply:
public MyPageController(IContentLoader contentLoader)
{
// Do something with contentLoader
}