feat:去除SqlSugarDbContextFactory的缓存
This commit is contained in:
@@ -37,14 +37,18 @@ namespace Yi.Framework.SqlSugarCore
|
|||||||
LazyServiceProvider = lazyServiceProvider;
|
LazyServiceProvider = lazyServiceProvider;
|
||||||
|
|
||||||
var connectionString = GetCurrentConnectionString();
|
var connectionString = GetCurrentConnectionString();
|
||||||
|
|
||||||
//获取连接配置操作,需要进行缓存
|
var connectionConfig =BuildConnectionConfig(action: options =>
|
||||||
var connectionConfig = ConnectionConfigCache.GetOrAdd(connectionString, (_) =>
|
{
|
||||||
BuildConnectionConfig(action: options =>
|
options.ConnectionString = connectionString;
|
||||||
{
|
options.DbType = GetCurrentDbType();
|
||||||
options.ConnectionString = connectionString;
|
});
|
||||||
options.DbType = GetCurrentDbType();
|
// var connectionConfig = ConnectionConfigCache.GetOrAdd(connectionString, (_) =>
|
||||||
}));
|
// BuildConnectionConfig(action: options =>
|
||||||
|
// {
|
||||||
|
// options.ConnectionString = connectionString;
|
||||||
|
// options.DbType = GetCurrentDbType();
|
||||||
|
// }));
|
||||||
SqlSugarClient = new SqlSugarClient(connectionConfig);
|
SqlSugarClient = new SqlSugarClient(connectionConfig);
|
||||||
//生命周期,以下都可以直接使用sqlsugardb了
|
//生命周期,以下都可以直接使用sqlsugardb了
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user