Initial commit carried over from private repo. This is V2.
This commit is contained in:
@ -0,0 +1,15 @@
|
||||
namespace MessengerApi.Configuration.Sources.Environment
|
||||
{
|
||||
public class EnvironmentConfigurationSource : IEnvironmentConfigurationSource
|
||||
{
|
||||
public bool HasKey(string key)
|
||||
{
|
||||
return !string.IsNullOrWhiteSpace(System.Environment.GetEnvironmentVariable(key));
|
||||
}
|
||||
|
||||
public T GetValue<T>(string key)
|
||||
{
|
||||
return (T)Convert.ChangeType(System.Environment.GetEnvironmentVariable(key), typeof(T));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user