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(); }