I have the below method in my dll class library
private void Download(string filename)
{
//am calling this value from appconfig
string ftpserverIp = System.Configuration.ConfigurationManager.AppSettings["ServerAddress"];
// somecode to download the file
}
Private void Upload(string filename)
{
string ftpserverIp = System.Configuration.ConfigurationManager.AppSettings["ServerAddress"];
// somecode to upload the file
}
Like that am getting all the values from appconfig for all my methods,is this any efficient way to call appconfig values ?
It won’t be costly at runtime.
However it will be a maintenance issue for maintaining the code. Perhaps a property would be beneficial.
The next logical step would be to write a custom configuration section.