-修复 pgsql jsonb poco 方案联表查询问题;#1549 #1071

This commit is contained in:
2881099
2023-06-27 21:24:53 +08:00
parent 116c753f0b
commit 3ff008fb58
26 changed files with 188 additions and 55 deletions

View File

@ -1953,6 +1953,13 @@ namespace FreeSql.Internal
continue;
}
var readType = trycol?.Attribute.MapType ?? prop.PropertyType;
if (trycol != null && trycol.Attribute.MapType != trycol.CsType) //#1549
{
var returnTarget86 = Expression.Label(typeof(object));
var valueExp86 = Expression.Constant("", typeof(string));
if (GetDataReaderValueBlockExpressionSwitchTypeFullName.Any(a => a(returnTarget86, valueExp86, trycol.CsType) != null))
readType = trycol.CsType;
}
var ispkExp = new List<Expression>();
var propGetSetMethod = prop.GetSetMethod(true);
Expression readVal = Expression.Assign(readpkvalExp, Expression.Call(MethodDataReaderGetValue, new Expression[] { commonUtilExp, rowExp, tryidxExp }));
@ -2006,7 +2013,7 @@ namespace FreeSql.Internal
}
}
if (trycol != null && trycol.Attribute.MapType != prop.PropertyType)
if (trycol != null && readType != prop.PropertyType)
ispkExp.Add(Expression.Assign(readExpValue, GetDataReaderValueBlockExpression(prop.PropertyType, readExpValue)));
ispkExp.Add(