In V8 you should be able to take advantage of DI to get access to that.
I would try something like this:
public classs MySurfaceController : SurfaceController
{
private readonly IGlobalSettings globalSettings;
public MySurfaceController(IGlobalSettings globalSettings)
{
this.globalSettings = globalSettings;
}
public ActionResult MyAction()
{
//do something with globalSettings
}
}
This should allow you access to that object assuming it is registered with the DI container. If it's not, I'm sure there will be a similar object that might wrap the global settings that can be injected.
GlobalSettings in a SurfaceController?
Can anyone point me to where/how I would get the IGlobalSetings object while executing in a SurfaceController?
Hello John,
The GlobalSettings Class contains general settings information for the entire Umbraco instance based on information from web.config appsettings check this https://our.umbraco.com/apidocs/v8/csharp/api/Umbraco.Core.Configuration.GlobalSettings.html
Hi John,
In V8 you should be able to take advantage of DI to get access to that.
I would try something like this:
This should allow you access to that object assuming it is registered with the DI container. If it's not, I'm sure there will be a similar object that might wrap the global settings that can be injected.
Thanks
Nik
is working on a reply...