mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 02:32:50 +08:00
- 修复 嵌套查询DTO映射可能触发循环引用 bug;
This commit is contained in:
parent
0b8f2127f7
commit
65bbee93a2
@ -18,7 +18,7 @@
|
|||||||
<SignAssembly>true</SignAssembly>
|
<SignAssembly>true</SignAssembly>
|
||||||
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
|
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
|
||||||
<DelaySign>false</DelaySign>
|
<DelaySign>false</DelaySign>
|
||||||
<Version>3.2.807-preview20231214</Version>
|
<Version>3.2.806</Version>
|
||||||
<PackageReadmeFile>readme.md</PackageReadmeFile>
|
<PackageReadmeFile>readme.md</PackageReadmeFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@ -2568,6 +2568,7 @@ namespace FreeSql.Internal
|
|||||||
{
|
{
|
||||||
if (tb == null || dtoProp == null || tb.Parameter == null) return null;
|
if (tb == null || dtoProp == null || tb.Parameter == null) return null;
|
||||||
var retList = new List<Expression[]>();
|
var retList = new List<Expression[]>();
|
||||||
|
var matchIgnores = new Dictionary<PropertyInfo, bool>();
|
||||||
var retExp = LocalMatch(tb.Parameter.Type, tb.Parameter);
|
var retExp = LocalMatch(tb.Parameter.Type, tb.Parameter);
|
||||||
if (retList.Any() == false) retList.Add(new[] { retExp });
|
if (retList.Any() == false) retList.Add(new[] { retExp });
|
||||||
return retList;
|
return retList;
|
||||||
@ -2584,7 +2585,9 @@ namespace FreeSql.Internal
|
|||||||
if (Utils.dicExecuteArrayRowReadClassOrTuple.ContainsKey(typeProp.PropertyType)) continue;
|
if (Utils.dicExecuteArrayRowReadClassOrTuple.ContainsKey(typeProp.PropertyType)) continue;
|
||||||
if (typeProp.PropertyType.IsAnonymousType() || _common.GetTableByEntity(typeProp.PropertyType)?.Columns.Any() == true)
|
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);
|
var ret = LocalMatch(typeProp.PropertyType, nextExp);
|
||||||
if (ret != null)
|
if (ret != null)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user