I am partly modifying an application where I will need to set value of the following constant to the value of the environment variable if exists.
What I already have:
private const string BuildPackagePath = @"\\server\build\";
What I would like to do is:
if (Environment.GetEnvironmentVariable("EnvVar") != null)
Set the property value to = Environment.GetEnvironmentVariable("EnvVar")
else
{Keep default/assigned value}
I understand that the left side of an asignment has to be a variable. I will probably have to change the type but was just wondering if anyone could give me an idea so the structure of current code can be kept as is.