From f4124db320d787cbabf035da05e926861d0d8334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Sat, 21 Jan 2023 23:15:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=BD=E7=9A=84=EF=BC=8C=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Extensions/SqlsugarCodeFirstExtensions.cs | 2 +- .../Yi.Framework.Core.Sqlsugar/Options/DbConnOptions.cs | 8 ++++---- .../YiFrameworkCoreSqlsugarModule.cs | 1 - Yi.Framework.Net6/src/project/Yi.Framework.Web/Program.cs | 1 - .../src/project/Yi.Framework.Web/TimeTest.txt | 1 + 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Extensions/SqlsugarCodeFirstExtensions.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Extensions/SqlsugarCodeFirstExtensions.cs index 8c98fee9..ec1f5888 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Extensions/SqlsugarCodeFirstExtensions.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Extensions/SqlsugarCodeFirstExtensions.cs @@ -19,7 +19,7 @@ namespace Yi.Framework.Core.Sqlsugar.Extensions var db = app.ApplicationServices.GetRequiredService(); var options = app.ApplicationServices.GetRequiredService>(); - //if (options.Value.EnabledCodeFirst == false) return; + if (options.Value.EnabledCodeFirst == false) return; var assemblys = new List(); diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Options/DbConnOptions.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Options/DbConnOptions.cs index f5ed700b..22a6fcd3 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Options/DbConnOptions.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Options/DbConnOptions.cs @@ -22,22 +22,22 @@ namespace Yi.Framework.Core.Sqlsugar.Options /// /// 开启种子数据 /// - public bool EnabledDbSeed = false; + public bool EnabledDbSeed { get; set; } = false; /// /// 开启读写分离 /// - public bool EnabledReadWrite = false; + public bool EnabledReadWrite { get; set; } = false; /// /// 开启codefirst /// - public bool EnabledCodeFirst = false; + public bool EnabledCodeFirst { get; set; }=false; /// /// 实体程序集 /// - public List? EntityAssembly; + public List? EntityAssembly { get; set; } /// /// 读写分离 diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/YiFrameworkCoreSqlsugarModule.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/YiFrameworkCoreSqlsugarModule.cs index e13674bb..5349b2b2 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/YiFrameworkCoreSqlsugarModule.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/YiFrameworkCoreSqlsugarModule.cs @@ -29,7 +29,6 @@ namespace Yi.Framework.Core.Sqlsugar //这里替换过滤器实现 services.AddScoped(); - var ss= Appsettings.appConfiguration("DbConnOptions", "EnabledCodeFirst"); services.Configure(Appsettings.appConfiguration("DbConnOptions")); services.AddSqlsugarServer(); diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Web/Program.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Web/Program.cs index 366cf1b2..007f2f28 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Web/Program.cs +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Web/Program.cs @@ -6,7 +6,6 @@ using Yi.Framework.Web; TimeTest.Start(); var builder = WebApplication.CreateBuilder(args); - //url builder.WebHost.UseStartUrlsServer(builder.Configuration); diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Web/TimeTest.txt b/Yi.Framework.Net6/src/project/Yi.Framework.Web/TimeTest.txt index 3cbeb894..a0295bb9 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Web/TimeTest.txt +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Web/TimeTest.txt @@ -83,3 +83,4 @@ 2023:01:21-22:21:52本次运行启动时间为:1563毫秒 2023:01:21-22:29:30本次运行启动时间为:9099毫秒 2023:01:21-22:30:38本次运行启动时间为:2136毫秒 +2023:01:21-23:15:24本次运行启动时间为:1944毫秒