mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Update navigate query
This commit is contained in:
parent
78fc491635
commit
e22d8c56b3
@ -240,7 +240,17 @@ namespace SqlSugar
|
||||
ilist.Add(bInfo);
|
||||
}
|
||||
}
|
||||
navObjectNamePropety.SetValue(listItem, instance);
|
||||
if (sql.MappingExpressions.HasValue())
|
||||
{
|
||||
MappingFieldsHelper<T> helper = new MappingFieldsHelper<T>();
|
||||
helper.NavEntity = bEntityInfo;
|
||||
helper.RootEntity = this.Context.EntityMaintenance.GetEntityInfo<T>();
|
||||
helper.SetChildList(navObjectNameColumnInfo, listItem, ilist.Cast<object>().ToList(), sql.MappingExpressions);
|
||||
}
|
||||
else
|
||||
{
|
||||
navObjectNamePropety.SetValue(listItem, instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -304,13 +314,25 @@ namespace SqlSugar
|
||||
{
|
||||
var setValue = navList
|
||||
.Where(x => navColumn.PropertyInfo.GetValue(x).ObjToString() == listItemPkColumn.PropertyInfo.GetValue(item).ObjToString()).ToList();
|
||||
var instance = Activator.CreateInstance(navObjectNamePropety.PropertyType, true);
|
||||
var ilist = instance as IList;
|
||||
foreach (var value in setValue)
|
||||
|
||||
if (sqlObj.MappingExpressions.HasValue())
|
||||
{
|
||||
ilist.Add(value);
|
||||
MappingFieldsHelper<T> helper = new MappingFieldsHelper<T>();
|
||||
helper.NavEntity = navEntityInfo;
|
||||
helper.RootEntity = this.Context.EntityMaintenance.GetEntityInfo<T>();
|
||||
helper.SetChildList(navObjectNameColumnInfo, item,setValue,sqlObj.MappingExpressions);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
var instance = Activator.CreateInstance(navObjectNamePropety.PropertyType, true);
|
||||
var ilist = instance as IList;
|
||||
foreach (var value in setValue)
|
||||
{
|
||||
ilist.Add(value);
|
||||
}
|
||||
navObjectNamePropety.SetValue(item, instance);
|
||||
}
|
||||
navObjectNamePropety.SetValue(item, instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user