Skip to content

Commit

Permalink
修复bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xuejmnet committed Nov 1, 2022
1 parent 339b543 commit 5166bf0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ShardingCore/Extensions/DbContextExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static void RemoveDbContextRelationModelThatIsShardingTable(this DbContex
contextModel.GetFieldValue("_entityTypes") as SortedDictionary<string, EntityType>;
foreach (var entityType in entityTypes)
{
if (entityType.GetFieldValue("_data") is List<object> _data)
if (entityType.Value.GetFieldValue("_data") is List<object> _data)
{
_data.Clear();
}
Expand Down Expand Up @@ -186,7 +186,7 @@ public static void RemoveDbContextAllRelationModelWithoutShardingDataSourceOnly(
contextModel.GetFieldValue("_entityTypes") as SortedDictionary<string, EntityType>;
foreach (var entityType in entityTypes)
{
if (entityType.GetFieldValue("_data") is List<object> _data)
if (entityType.Value.GetFieldValue("_data") is List<object> _data)
{
_data.Clear();
}
Expand Down

0 comments on commit 5166bf0

Please sign in to comment.