mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 12:28:15 +08:00
- 修复 MapType 复杂表达式树解析 bug;#1062
This commit is contained in:
@ -526,7 +526,8 @@ namespace FreeSql.Internal.CommonProvider
|
||||
var memberName = initExp.Bindings[a].Member.Name;
|
||||
if (_table.ColumnsByCsIgnore.ContainsKey(memberName)) continue;
|
||||
if (_table.ColumnsByCs.TryGetValue(memberName, out var col) == false) throw new Exception($"找不到属性:{memberName}");
|
||||
var memberValue = _commonExpression.ExpressionLambdaToSql(initAssignExp.Expression, new CommonExpression.ExpTSC { isQuoteName = true, mapType = col.Attribute.MapType });
|
||||
var memberValue = _commonExpression.ExpressionLambdaToSql(initAssignExp.Expression, new CommonExpression.ExpTSC { isQuoteName = true,
|
||||
mapType = initAssignExp.Expression is BinaryExpression ? null : col.Attribute.MapType });
|
||||
_setIncr.Append(", ").Append(_commonUtils.QuoteSqlName(col.Attribute.Name)).Append(" = ").Append(memberValue);
|
||||
}
|
||||
}
|
||||
@ -540,7 +541,8 @@ namespace FreeSql.Internal.CommonProvider
|
||||
var memberName = newExp.Members[a].Name;
|
||||
if (_table.ColumnsByCsIgnore.ContainsKey(memberName)) continue;
|
||||
if (_table.ColumnsByCs.TryGetValue(memberName, out var col) == false) throw new Exception($"找不到属性:{memberName}");
|
||||
var memberValue = _commonExpression.ExpressionLambdaToSql(newExp.Arguments[a], new CommonExpression.ExpTSC { isQuoteName = true, mapType = col.Attribute.MapType });
|
||||
var memberValue = _commonExpression.ExpressionLambdaToSql(newExp.Arguments[a], new CommonExpression.ExpTSC { isQuoteName = true,
|
||||
mapType = newExp.Arguments[a] is BinaryExpression ? null : col.Attribute.MapType });
|
||||
_setIncr.Append(", ").Append(_commonUtils.QuoteSqlName(col.Attribute.Name)).Append(" = ").Append(memberValue);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user