发布x.3.1.13

This commit is contained in:
xuejiaming 2021-10-27 20:17:30 +08:00
parent eb7e92f64f
commit ffd3025a7a
2 changed files with 10 additions and 7 deletions

View File

@ -1,8 +1,8 @@
:start
::定义版本
set EFCORE2=2.3.1.12
set EFCORE3=3.3.1.12
set EFCORE5=5.3.1.12
set EFCORE2=2.3.1.13
set EFCORE3=3.3.1.13
set EFCORE5=5.3.1.13
::删除所有bin与obj下的文件
@echo off

View File

@ -79,11 +79,14 @@ namespace ShardingCore
foreach (var entity in context.Model.GetEntityTypes())
{
var entityType = entity.ClrType;
var primaryKeyNames = ShardingKeyUtil.ParsePrimaryKeyName(entity);
if (primaryKeyNames.Properties.Count == 1)
if (entityType.IsShardingDataSource() || entityType.IsShardingTable())
{
var shardingEntityConfig = ShardingUtil.Parse(entityType);
shardingEntityConfig.SinglePrimaryKeyFieldName = primaryKeyNames.Properties.First().Name;
var primaryKeyNames = ShardingKeyUtil.ParsePrimaryKeyName(entity);
if (primaryKeyNames.Properties.Count == 1)
{
var shardingEntityConfig = ShardingUtil.Parse(entityType);
shardingEntityConfig.SinglePrimaryKeyFieldName = primaryKeyNames.Properties.First().Name;
}
}
//添加追踪模型
_trackerManager.AddDbContextModel(entityType);