From 7e08811190fd06617d4717bfda101e37ca972e7a Mon Sep 17 00:00:00 2001 From: liguoyang Date: Fri, 12 Jan 2024 16:03:11 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=8F=96=E6=B6=88=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E7=94=9F=E6=88=90=E8=A1=A8=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Dlhis.Basic/SqlSugarPack.cs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Src/Dlhis.Basic/SqlSugarPack.cs b/Src/Dlhis.Basic/SqlSugarPack.cs index 7d2d592e..19fdbfbe 100644 --- a/Src/Dlhis.Basic/SqlSugarPack.cs +++ b/Src/Dlhis.Basic/SqlSugarPack.cs @@ -18,21 +18,21 @@ public class SqlSugarPack : BaseAppPack public override void Configure(IApplicationBuilder app, IWebHostEnvironment env) { #if DEBUG - using var scope = app.ApplicationServices.CreateScope(); - var db = scope.ServiceProvider.GetService(); - var tables = App.ActiveTyps.Where(x => x.IsDefined(typeof(SugarTable), false)) - .Where(x => !x.IsDefined(typeof(SkipScanAttribute), false)) - .ToArray(); + //using var scope = app.ApplicationServices.CreateScope(); + //var db = scope.ServiceProvider.GetService(); + //var tables = App.ActiveTyps.Where(x => x.IsDefined(typeof(SugarTable), false)) + // .Where(x => !x.IsDefined(typeof(SkipScanAttribute), false)) + // .ToArray(); - db.DbMaintenance.CreateDatabase(); - db.CodeFirst.InitTables(tables); + //db.DbMaintenance.CreateDatabase(); + //db.CodeFirst.InitTables(tables); - using var scopeFace = app.ApplicationServices.CreateScope(); - var dbFace = scopeFace.ServiceProvider.GetService(); - var faceConnectionString = Configuration.GetSection("SqlSugarOptions:FaceConnectionString").Value; - dbFace.CurrentConnectionConfig.ConnectionString = faceConnectionString; - dbFace.DbMaintenance.CreateDatabase(); - dbFace.CodeFirst.InitTables(); + //using var scopeFace = app.ApplicationServices.CreateScope(); + //var dbFace = scopeFace.ServiceProvider.GetService(); + //var faceConnectionString = Configuration.GetSection("SqlSugarOptions:FaceConnectionString").Value; + //dbFace.CurrentConnectionConfig.ConnectionString = faceConnectionString; + //dbFace.DbMaintenance.CreateDatabase(); + //dbFace.CodeFirst.InitTables(); #endif }