Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Can anyone point me to where/how I would get the IGlobalSetings object while executing in a SurfaceController?
The GlobalSettings Class contains general settings information for the entire Umbraco instance based on information from web.config
check this https://our.umbraco.com/apidocs/v8/csharp/api/Umbraco.Core.Configuration.GlobalSettings.html
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.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted