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();