@ -197,7 +197,7 @@ namespace SqlSugar
var bEntity = navObjectNameColumnInfo . PropertyInfo . PropertyType . GetGenericArguments ( ) [ 0 ] ;
var bEntityInfo = this . Context . EntityMaintenance . GetEntityInfo ( bEntity ) ;
var bPkColumn = bEntityInfo . Columns . FirstOrDefault ( it = > it . IsPrimarykey ) ;
this . Context . InitMappingInfo ( bEntity ) ;
var listItemPkColumn = listItemEntity . Columns . Where ( it = > it . IsPrimarykey ) . FirstOrDefault ( ) ;
var ids = list . Select ( it = > it . GetType ( ) . GetProperty ( listItemPkColumn . PropertyName ) . GetValue ( it ) ) . Select ( it = > it = = null ? "null" : it ) . Distinct ( ) . ToList ( ) ;
var mappingEntity = this . Context . EntityMaintenance . GetEntityInfo ( navObjectNameColumnInfo . Navigat . MappingType ) ;
@ -262,6 +262,7 @@ namespace SqlSugar
var navColumn = listItemEntity . Columns . FirstOrDefault ( it = > it . PropertyName = = navObjectNameColumnInfo . Navigat . Name ) ;
var navType = navObjectNamePropety . PropertyType ;
var navEntityInfo = this . Context . EntityMaintenance . GetEntityInfo ( navType ) ;
this . Context . InitMappingInfo ( navEntityInfo . Type ) ;
var navPkColumn = navEntityInfo . Columns . Where ( it = > it . IsPrimarykey ) . FirstOrDefault ( ) ;
Check . ExceptionEasy ( navPkColumn = = null , navEntityInfo . EntityName + "need primarykey" , navEntityInfo . EntityName + " 需要主键" ) ;
var ids = list . Select ( it = > it . GetType ( ) . GetProperty ( navObjectNameColumnInfo . Navigat . Name ) . GetValue ( it ) ) . Select ( it = > it = = null ? "null" : it ) . Distinct ( ) . ToList ( ) ;
@ -290,6 +291,7 @@ namespace SqlSugar
{
var navEntity = navObjectNameColumnInfo . PropertyInfo . PropertyType . GetGenericArguments ( ) [ 0 ] ;
var navEntityInfo = this . Context . EntityMaintenance . GetEntityInfo ( navEntity ) ;
this . Context . InitMappingInfo ( navEntityInfo . Type ) ;
var navColumn = navEntityInfo . Columns . FirstOrDefault ( it = > it . PropertyName = = navObjectNameColumnInfo . Navigat . Name ) ;
Check . ExceptionEasy ( navColumn = = null , $"{navEntityInfo.EntityName} not found {navObjectNameColumnInfo.Navigat.Name} " , $"实体 {navEntityInfo.EntityName} 未找到导航配置列 {navObjectNameColumnInfo.Navigat.Name} " ) ;
//var navType = navObjectNamePropety.PropertyType;