mirror of https://github.com/ogoun/Zero.git
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.
26 lines
801 B
26 lines
801 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;
|
|
string value = (enumerator.Entry.Value as string) ?? string.Empty;
|
|
result.Append(key, value);
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public IConfigurationSet ReadConfigurationSet()
|
|
{
|
|
return Configuration.CreateSet(ReadConfiguration());
|
|
}
|
|
}
|
|
} |