Skip to content

Commit ffd3025

Browse files
committed
发布x.3.1.13
1 parent eb7e92f commit ffd3025

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

nuget-publish.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
:start
22
::定义版本
3-
set EFCORE2=2.3.1.12
4-
set EFCORE3=3.3.1.12
5-
set EFCORE5=5.3.1.12
3+
set EFCORE2=2.3.1.13
4+
set EFCORE3=3.3.1.13
5+
set EFCORE5=5.3.1.13
66

77
::删除所有bin与obj下的文件
88
@echo off

src/ShardingCore/ShardingDbContextBootstrapper.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,14 @@ public void Init()
7979
foreach (var entity in context.Model.GetEntityTypes())
8080
{
8181
var entityType = entity.ClrType;
82-
var primaryKeyNames = ShardingKeyUtil.ParsePrimaryKeyName(entity);
83-
if (primaryKeyNames.Properties.Count == 1)
82+
if (entityType.IsShardingDataSource() || entityType.IsShardingTable())
8483
{
85-
var shardingEntityConfig = ShardingUtil.Parse(entityType);
86-
shardingEntityConfig.SinglePrimaryKeyFieldName = primaryKeyNames.Properties.First().Name;
84+
var primaryKeyNames = ShardingKeyUtil.ParsePrimaryKeyName(entity);
85+
if (primaryKeyNames.Properties.Count == 1)
86+
{
87+
var shardingEntityConfig = ShardingUtil.Parse(entityType);
88+
shardingEntityConfig.SinglePrimaryKeyFieldName = primaryKeyNames.Properties.First().Name;
89+
}
8790
}
8891
//添加追踪模型
8992
_trackerManager.AddDbContextModel(entityType);

0 commit comments

Comments
 (0)