diff --git a/nuget-publish.bat b/nuget-publish.bat index 99f4c35c..256a66de 100644 --- a/nuget-publish.bat +++ b/nuget-publish.bat @@ -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 diff --git a/src/ShardingCore/Sharding/AbstractShardingDbContext.cs b/src/ShardingCore/Sharding/AbstractShardingDbContext.cs index c5005785..a93cd474 100644 --- a/src/ShardingCore/Sharding/AbstractShardingDbContext.cs +++ b/src/ShardingCore/Sharding/AbstractShardingDbContext.cs @@ -47,6 +47,7 @@ namespace ShardingCore.Sharding private DbContextOptions _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; }