You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Zero/ZeroLevel/Services/Config/Implementation/EnvironmentVariablesConfigR...

27 lines
800 B

using System;
namespace ZeroLevel.Services.Config.Implementation
{
internal sealed class EnvironmentVariablesConfigReader
: IConfigurationReader
{
public IConfiguration ReadConfiguration()
{
var result = Configuration.Create();
var enumerator = Environment.GetEnvironmentVariables().GetEnumerator();
while (enumerator.MoveNext())
{
string key = (string)enumerator.Entry.Key;
1 year ago
string value = ((string)enumerator.Entry.Value) ?? string.Empty;
result.Append(key, value);
}
return result;
}
public IConfigurationSet ReadConfigurationSet()
{
return Configuration.CreateSet(ReadConfiguration());
}
}
}

Powered by TurnKey Linux.