25 lines
617 B
C#
25 lines
617 B
C#
|
|
using Microsoft.Extensions.Configuration;
|
|||
|
|
using System.IO;
|
|||
|
|
|
|||
|
|
namespace RIZO.Server.Configuration
|
|||
|
|
{
|
|||
|
|
public class Configuration : IConfiguration.IConfiguration
|
|||
|
|
{
|
|||
|
|
private static IConfigurationRoot configurationRoot;
|
|||
|
|
|
|||
|
|
static Configuration()
|
|||
|
|
{
|
|||
|
|
var builder = new ConfigurationBuilder()
|
|||
|
|
.SetBasePath(Directory.GetCurrentDirectory())
|
|||
|
|
.AddJsonFile("appsettings.json");
|
|||
|
|
|
|||
|
|
configurationRoot = builder.Build();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public string Read(string key)
|
|||
|
|
{
|
|||
|
|
return configurationRoot[key];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|