From 5166bf01d7147aedf2b6e29a12bd20b2ee2a7631 Mon Sep 17 00:00:00 2001 From: xuejiaming <326308290@qq.com> Date: Tue, 1 Nov 2022 13:59:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ShardingCore/Extensions/DbContextExtension.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ShardingCore/Extensions/DbContextExtension.cs b/src/ShardingCore/Extensions/DbContextExtension.cs index 98d4f2c8..c4da52ed 100644 --- a/src/ShardingCore/Extensions/DbContextExtension.cs +++ b/src/ShardingCore/Extensions/DbContextExtension.cs @@ -85,7 +85,7 @@ public static void RemoveDbContextRelationModelThatIsShardingTable(this DbContex contextModel.GetFieldValue("_entityTypes") as SortedDictionary; foreach (var entityType in entityTypes) { - if (entityType.GetFieldValue("_data") is List _data) + if (entityType.Value.GetFieldValue("_data") is List _data) { _data.Clear(); } @@ -186,7 +186,7 @@ public static void RemoveDbContextAllRelationModelWithoutShardingDataSourceOnly( contextModel.GetFieldValue("_entityTypes") as SortedDictionary; foreach (var entityType in entityTypes) { - if (entityType.GetFieldValue("_data") is List _data) + if (entityType.Value.GetFieldValue("_data") is List _data) { _data.Clear(); }