From 1e715ffa2e19276aea53c2f033f25557533189bd Mon Sep 17 00:00:00 2001 From: xuejiaming <326308290@qq.com> Date: Sat, 20 Apr 2024 09:09:35 +0800 Subject: [PATCH] [#266] 7.x.1.21 --- nuget-publish.bat | 12 ++++++------ ...AbstractShardingOperatorVirtualDataSourceRoute.cs | 4 ++++ .../AbstractShardingOperatorVirtualTableRoute.cs | 5 +++++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/nuget-publish.bat b/nuget-publish.bat index fa2e6bfe..68d26b58 100644 --- a/nuget-publish.bat +++ b/nuget-publish.bat @@ -1,11 +1,11 @@ :start ::定义版本 -set EFCORE8=7.8.1.20 -set EFCORE7=7.7.1.20 -set EFCORE6=7.6.1.20 -set EFCORE5=7.5.1.20 -set EFCORE3=7.3.1.20 -set EFCORE2=7.2.1.20 +set EFCORE8=7.8.1.21 +set EFCORE7=7.7.1.21 +set EFCORE6=7.6.1.21 +set EFCORE5=7.5.1.21 +set EFCORE3=7.3.1.21 +set EFCORE2=7.2.1.21 ::删除所有bin与obj下的文件 @echo off diff --git a/src/ShardingCore/Core/VirtualRoutes/DataSourceRoutes/Abstractions/AbstractShardingOperatorVirtualDataSourceRoute.cs b/src/ShardingCore/Core/VirtualRoutes/DataSourceRoutes/Abstractions/AbstractShardingOperatorVirtualDataSourceRoute.cs index 11fa6a81..f8e66dc4 100644 --- a/src/ShardingCore/Core/VirtualRoutes/DataSourceRoutes/Abstractions/AbstractShardingOperatorVirtualDataSourceRoute.cs +++ b/src/ShardingCore/Core/VirtualRoutes/DataSourceRoutes/Abstractions/AbstractShardingOperatorVirtualDataSourceRoute.cs @@ -35,6 +35,10 @@ namespace ShardingCore.Core.VirtualRoutes.DataSourceRoutes.Abstractions public virtual object GetCompareValueByShardingKey(object shardingKey, string shardingPropertyName) { + if (EntityMetadata.IsMainShardingDataSourceKey(shardingPropertyName)) + { + return ShardingKeyToDataSourceName(shardingKey); + } return shardingKey; } diff --git a/src/ShardingCore/Core/VirtualRoutes/TableRoutes/Abstractions/AbstractShardingOperatorVirtualTableRoute.cs b/src/ShardingCore/Core/VirtualRoutes/TableRoutes/Abstractions/AbstractShardingOperatorVirtualTableRoute.cs index 2a7acd93..b728b02e 100644 --- a/src/ShardingCore/Core/VirtualRoutes/TableRoutes/Abstractions/AbstractShardingOperatorVirtualTableRoute.cs +++ b/src/ShardingCore/Core/VirtualRoutes/TableRoutes/Abstractions/AbstractShardingOperatorVirtualTableRoute.cs @@ -40,8 +40,13 @@ namespace ShardingCore.Core.VirtualRoutes.TableRoutes.Abstractions return sqlRouteUnits; } + public virtual object GetCompareValueByShardingKey(object shardingKey, string shardingPropertyName) { + if (EntityMetadata.IsMainShardingTableKey(shardingPropertyName)) + { + return ShardingKeyToTail(shardingKey); + } return shardingKey; }