mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-19 10:08:04 +08:00
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Autofac;
|
||||
using Infrastructure;
|
||||
using Infrastructure.Extensions.AutofacManager;
|
||||
@@ -88,9 +89,10 @@ namespace OpenAuth.Mvc
|
||||
services.Configure<AppSetting>(Configuration.GetSection("AppSetting"));
|
||||
|
||||
//在startup里面只能通过这种方式获取到appsettings里面的值,不能用IOptions😰
|
||||
var dbType = ((ConfigurationSection)Configuration.GetSection("AppSetting:DbType")).Value;
|
||||
var dbtypes = ((ConfigurationSection)Configuration.GetSection("AppSetting:DbTypes")).GetChildren()
|
||||
.ToDictionary(x => x.Key, x => x.Value);
|
||||
var connectionString = Configuration.GetConnectionString("OpenAuthDBContext");
|
||||
logger.LogInformation($"当前数据库类型:{dbType},连接字符串:{connectionString}");
|
||||
logger.LogInformation($"系统配置的数据库类型:{JsonHelper.Instance.Serialize(dbtypes)},连接字符串:{connectionString}");
|
||||
|
||||
services.AddDbContext<OpenAuthDBContext>();
|
||||
|
||||
|
Reference in New Issue
Block a user