How to access system setting inside a Configuration Service?

Dear Community,

Please help me  with accessing System Setting inside a configuration service/ Source code.

Thank you.

Like 0



Hello S Gokul Aditya, 

Could you please specify what exactly do you have problem with? 
Are you not able to find System Settings in the configuration? 
Are you able to find the Systems Settings but not able to change the values? 

Looking forward to your response. 
Best regards, 

Hi Gokul. You can access system settings inside source code using the Terrasoft.Core.Configuration.SysSettings.GetValue method. Pls find below a code snippet - 

var settingName = "UsrMyCustomSetting";
var appConnection = HttpContext.Current.Application["AppConnection"] as AppConnection;
var settingVal = Terrasoft.Core.Configuration.SysSettings.GetValue<string>(appConnection.SystemUserConnection, settingName);

Alternatively, you can also use the UserConnection as against SystemUserConnection used above.

This question has been answered in this Community question already -

The above code snippet is available here -

Thank you Shrikanth. I will check these links.

Show all comments