From 65897bd781daeee9d90e5d423d5fed8176e94f51 Mon Sep 17 00:00:00 2001 From: fyf Date: Sat, 30 Apr 2022 16:54:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=BF=9E=E6=8E=A5=E5=9C=B0?= =?UTF-8?q?=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataVAPI/AppConfig/AppConfigurtaionServices.cs | 4 ---- DataVAPI/Startup.cs | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/DataVAPI/AppConfig/AppConfigurtaionServices.cs b/DataVAPI/AppConfig/AppConfigurtaionServices.cs index af00a0f..8724cd7 100644 --- a/DataVAPI/AppConfig/AppConfigurtaionServices.cs +++ b/DataVAPI/AppConfig/AppConfigurtaionServices.cs @@ -16,10 +16,6 @@ namespace DataVAPI.AppConfig .SetBasePath(AppDomain.CurrentDomain.BaseDirectory) .Add(new JsonConfigurationSource { Path = "appsettings.json", ReloadOnChange = true }) .Build(); - - DataBus.connStr = Configuration.GetSection("mongoDB:connStr").Value; - DataBus.dbName = Configuration.GetSection("mongoDB:dbName").Value; - } } } diff --git a/DataVAPI/Startup.cs b/DataVAPI/Startup.cs index 3e12221..34c4f68 100644 --- a/DataVAPI/Startup.cs +++ b/DataVAPI/Startup.cs @@ -25,7 +25,8 @@ namespace DataVAPI public void ConfigureServices(IServiceCollection services) { SugarDb.Conn = Configuration["DbConnectionstring"].ToString(); - + DataBus.connStr = Configuration["mongoDB.connStr"].ToString(); + DataBus.dbName = Configuration["mongoDB.dbName"].ToString(); //注册swagger服务 services.AddSwaggerUp(); services.AddControllers();