From b49ae9c034bf806d53f05f79b9d85bc4b05567c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Wed, 3 Jul 2024 09:18:33 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Uow/UnitOfWorkSqlsugarDbContextProvider.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore/Uow/UnitOfWorkSqlsugarDbContextProvider.cs b/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore/Uow/UnitOfWorkSqlsugarDbContextProvider.cs index b76e6c8d..f96e7e81 100644 --- a/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore/Uow/UnitOfWorkSqlsugarDbContextProvider.cs +++ b/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore/Uow/UnitOfWorkSqlsugarDbContextProvider.cs @@ -54,10 +54,6 @@ namespace Yi.Framework.SqlSugarCore.Uow var unitOfWork = UnitOfWorkManager.Current; if (unitOfWork == null /*|| unitOfWork.Options.IsTransactional == false*/) { - //if (ContextInstance.Current is null) - //{ - // ContextInstance.Current = ; - //} var dbContext = (TDbContext)ServiceProvider.GetRequiredService(); //提高体验,取消工作单元强制性 //throw new AbpException("A DbContext can only be created inside a unit of work!"); @@ -81,7 +77,7 @@ namespace Yi.Framework.SqlSugarCore.Uow CreateDbContextAsync(unitOfWork, connectionStringName, connectionString).Result ); - await Console.Out.WriteLineAsync(">>>----------------实例化了db"+ ((SqlSugarDatabaseApi)databaseApi).DbContext.SqlSugarClient.ContextID.ToString()); + //await Console.Out.WriteLineAsync(">>>----------------实例化了db"+ ((SqlSugarDatabaseApi)databaseApi).DbContext.SqlSugarClient.ContextID.ToString()); //创建的db加入到当前工作单元中 unitOfWork.AddDatabaseApi(dbContextKey, databaseApi);