mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 12:28:15 +08:00
- 修复 嵌套查询DTO映射可能触发循环引用 bug;
This commit is contained in:
@ -2568,6 +2568,7 @@ namespace FreeSql.Internal
|
||||
{
|
||||
if (tb == null || dtoProp == null || tb.Parameter == null) return null;
|
||||
var retList = new List<Expression[]>();
|
||||
var matchIgnores = new Dictionary<PropertyInfo, bool>();
|
||||
var retExp = LocalMatch(tb.Parameter.Type, tb.Parameter);
|
||||
if (retList.Any() == false) retList.Add(new[] { retExp });
|
||||
return retList;
|
||||
@ -2584,7 +2585,9 @@ namespace FreeSql.Internal
|
||||
if (Utils.dicExecuteArrayRowReadClassOrTuple.ContainsKey(typeProp.PropertyType)) continue;
|
||||
if (typeProp.PropertyType.IsAnonymousType() || _common.GetTableByEntity(typeProp.PropertyType)?.Columns.Any() == true)
|
||||
{
|
||||
var nextExp = Expression.MakeMemberAccess(memExp, typeProp);
|
||||
if (matchIgnores.ContainsKey(typeProp)) continue;
|
||||
matchIgnores.Add(typeProp, true);
|
||||
var nextExp = Expression.MakeMemberAccess(memExp, typeProp);
|
||||
var ret = LocalMatch(typeProp.PropertyType, nextExp);
|
||||
if (ret != null)
|
||||
{
|
||||
|
Reference in New Issue
Block a user