修复x.2版本的更新后无法再次查询bug

This commit is contained in:
xuejiaming 2021-12-28 09:58:30 +08:00
parent 85f854577d
commit ec6ff3f53e
2 changed files with 9 additions and 4 deletions

View File

@ -1,8 +1,8 @@
:start
::定义版本
set EFCORE2=2.2.0.22-efcore2.1.0
set EFCORE3=3.2.0.22
set EFCORE5=5.2.0.22
set EFCORE2=2.2.0.23
set EFCORE3=3.2.0.23
set EFCORE5=5.2.0.23
::删除所有bin与obj下的文件
@echo off

View File

@ -47,6 +47,7 @@ namespace ShardingCore.Sharding
private DbContextOptions<T> _dbContextOptions;
private readonly object CREATELOCK = new object();
private string connectionString;
public AbstractShardingDbContext(DbContextOptions options) : base(options)
{
@ -97,7 +98,11 @@ namespace ShardingCore.Sharding
}
public string GetConnectionString()
{
return Database.GetDbConnection().ConnectionString;
if (null == connectionString)
{
connectionString = Database.GetDbConnection().ConnectionString;
}
return connectionString;
}