- 修复 3.2.689 WithTempQuery DTO 映射查询问题;#1441 #1436 #1434 #1433 #1431 #1429 #1427 #1425 #1417 #1413 #1412 #1319

This commit is contained in:
2881099
2023-03-02 16:37:22 +08:00
parent da7bb7c74d
commit dc4d70b325
6 changed files with 35 additions and 68 deletions

View File

@ -2514,7 +2514,8 @@ namespace FreeSql.Internal
{
if (tb == null || dtoProp == null || tb.Parameter == null) return null;
var retList = new List<Expression[]>();
LocalMatch(tb.Parameter.Type, tb.Parameter);
var retExp = LocalMatch(tb.Parameter.Type, tb.Parameter);
if (retList.Any() == false) retList.Add(new[] { retExp });
return retList;
Expression LocalMatch(Type type, Expression memExp)

View File

@ -632,7 +632,7 @@ namespace FreeSql.Internal
var propTypeIsObservableCollection = propElementType != null && pnv.PropertyType == typeof(ObservableCollection<>).MakeGenericType(propElementType);
#region islazy
void LocalManyLazyLoadingCode(PropertyInfo refprop, string cscodeExtLogic1, string cscodeExtLogic2, string lmbdWhere)
void LocalOneToManyLazyLoadingCode(PropertyInfo refprop, string cscodeExtLogic1, string cscodeExtLogic2, string lmbdWhere)
{
cscode.Append(" private bool __lazy__").Append(pnv.Name).AppendLine(" = false;")
.Append(" ").Append(propModification).Append(" override ").Append(propTypeName).Append(" ").Append(pnv.Name).AppendLine(" {");
@ -768,7 +768,7 @@ namespace FreeSql.Internal
nvref.RefType = TableRefType.OneToMany;
trytb.AddOrUpdateTableRef(pnv.Name, nvref);
}
if (isLazy) LocalManyLazyLoadingCode(null, null, null, lmbdWhere.ToString());
if (isLazy) LocalOneToManyLazyLoadingCode(null, null, null, lmbdWhere.ToString());
}
else
{
@ -802,6 +802,7 @@ namespace FreeSql.Internal
}
if (isLazy) LocalLazyLoadingCode(lmbdWhere.ToString());
}
return;
}
#endregion
@ -1401,7 +1402,7 @@ namespace FreeSql.Internal
}
}
if (isLazy) LocalManyLazyLoadingCode(refprop, cscodeExtLogic1, cscodeExtLogic2, lmbdWhere.ToString());
if (isLazy) LocalOneToManyLazyLoadingCode(refprop, cscodeExtLogic1, cscodeExtLogic2, lmbdWhere.ToString());
}
}
else