Merge branch 'main' of github.com:dotnetcore/sharding-core

This commit is contained in:
xuejiaming 2022-10-31 23:33:52 +08:00
commit cef363552b
1 changed files with 7 additions and 4 deletions

View File

@ -67,13 +67,16 @@ namespace ShardingCore.Core.TrackerManagers
public Type TranslateEntityType(Type entityType)
{
if (!_dbContextModels.ContainsKey(entityType))
if (_shardingConfigOptions.UseEntityFrameworkCoreProxies)
{
if (_shardingConfigOptions.UseEntityFrameworkCoreProxies && entityType.BaseType != null)
if (!_dbContextModels.ContainsKey(entityType))
{
if (_dbContextModels.ContainsKey(entityType.BaseType))
if (entityType.BaseType != null)
{
return entityType.BaseType;
if (_dbContextModels.ContainsKey(entityType.BaseType))
{
return entityType.BaseType;
}
}
}
}