Код: Выделить всё
//Variables stored in appsettings.json file
string ServiceName = _configuration[Configuration.EnvConfig + ":NewService"];
string VendorName = _configuration[Configuration.EnvConfig + ":NewVendor"];
string RelationshipManager = _configuration[Configuration.EnvConfig + ":RelationshipManager"];
// Date is stored in configuration class so that it can be passed to other class files for validation
private static string thisDay = Configuration.currentDate.ToString();
public string NewVendorName()
{
string NewVendorName = thisDay + VendorName;
return NewVendorName;
}
public string NewServiceName()
{
string NewServiceName = thisDay + ServiceName;
return NewServiceName;
}
Я Я пробовал использовать набор get, но не смог заставить его работать из-за ненулевых значений.
Я также пытался установить для строк, поступающих из appsettings.json, значение «private». static», но во время выполнения возникает ошибка.
Код: Выделить всё
//Variables stored in appsettings.json file
private static string ServiceName = _configuration[Configuration.EnvConfig + ":NewService"];
private static string VendorName = _configuration[Configuration.EnvConfig + ":NewVendor"];
private static string RelationshipManager = _configuration[Configuration.EnvConfig + ":RelationshipManager"];
// Date is stored in configuration class so that it can be passed to other class files for validation
private static string thisDay = Configuration.currentDate.ToString();
string NewVendorName = thisDay + VendorName;
string NewServiceName = thisDay + ServiceName;
Подробнее здесь: https://stackoverflow.com/questions/790 ... and-dateti
Мобильная версия