diff --git a/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore/SqlSugarDbContextFactory.cs b/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore/SqlSugarDbContextFactory.cs index 3012a94c..1c7bcacf 100644 --- a/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore/SqlSugarDbContextFactory.cs +++ b/Yi.Abp.Net8/framework/Yi.Framework.SqlSugarCore/SqlSugarDbContextFactory.cs @@ -37,14 +37,18 @@ namespace Yi.Framework.SqlSugarCore LazyServiceProvider = lazyServiceProvider; var connectionString = GetCurrentConnectionString(); - - //获取连接配置操作,需要进行缓存 - var connectionConfig = ConnectionConfigCache.GetOrAdd(connectionString, (_) => - BuildConnectionConfig(action: options => - { - options.ConnectionString = connectionString; - options.DbType = GetCurrentDbType(); - })); + + var connectionConfig =BuildConnectionConfig(action: options => + { + options.ConnectionString = connectionString; + options.DbType = GetCurrentDbType(); + }); + // var connectionConfig = ConnectionConfigCache.GetOrAdd(connectionString, (_) => + // BuildConnectionConfig(action: options => + // { + // options.ConnectionString = connectionString; + // options.DbType = GetCurrentDbType(); + // })); SqlSugarClient = new SqlSugarClient(connectionConfig); //生命周期,以下都可以直接使用sqlsugardb了