OpenAuth.Net/Infrastructure/Helpers/ConfigHelper.cs
yubaolee 452de01fb8 fix #I3SKUV 增加API和EF执行效率的监控
新增流程修改接口
增加启动及撤销判定
2021-05-25 00:49:12 +08:00

22 lines
786 B
C#

using System;
using Microsoft.Extensions.Configuration;
namespace Infrastructure.Helpers
{
public class ConfigHelper
{
public static IConfigurationRoot GetConfigRoot()
{
var configurationBuilder = new ConfigurationBuilder();
configurationBuilder.SetBasePath(System.IO.Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddJsonFile(
$"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Development"}.json",
optional: true)
.AddEnvironmentVariables();
var configuration = configurationBuilder.Build();
return configuration;
}
}
}