优化bug

This commit is contained in:
xuejiaming 2022-07-04 23:49:52 +08:00
parent 56d16abf90
commit 4ad6b06f1d
2 changed files with 3 additions and 3 deletions

View File

@ -170,7 +170,7 @@ namespace ShardingCore.DynamicDataSources
if (context is IShardingDbContext shardingDbContext)
{
using (var dbContext =
shardingDbContext.GetDbContext(dataSourceName, false,
shardingDbContext.GetDbContext(dataSourceName, true,
_routeTailFactory.Create(string.Empty, false)))
{
var isDefault = virtualDataSource.IsDefault(dataSourceName);
@ -193,7 +193,7 @@ namespace ShardingCore.DynamicDataSources
{
if (context is IShardingDbContext shardingDbContext)
{
using (var dbContext = shardingDbContext.GetDbContext(dataSourceName, false,
using (var dbContext = shardingDbContext.GetDbContext(dataSourceName, true,
_routeTailFactory.Create(string.Empty, false)))
{
dbContext.RemoveDbContextAllRelationModel();

View File

@ -54,7 +54,7 @@ namespace ShardingCore.TableCreator
{
var shardingDbContext = (IShardingDbContext)dbContext;
using (var context = shardingDbContext.GetDbContext(dataSourceName, false,
using (var context = shardingDbContext.GetDbContext(dataSourceName, true,
_routeTailFactory.Create(tail, false)))
{
context.RemoveDbContextRelationModelSaveOnlyThatIsNamedType(shardingEntityType);