File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments