|
@ -44,26 +44,45 @@ namespace SqlSugar |
|
|
throw new NotSupportedException(); |
|
|
throw new NotSupportedException(); |
|
|
} |
|
|
} |
|
|
MemberAssignment memberAssignment = (MemberAssignment)binding; |
|
|
MemberAssignment memberAssignment = (MemberAssignment)binding; |
|
|
|
|
|
var memberName = memberAssignment.Member.Name; |
|
|
var item = memberAssignment.Expression; |
|
|
var item = memberAssignment.Expression; |
|
|
if (item.NodeType == ExpressionType.Constant || (item is MemberExpression) && ((MemberExpression)item).Expression.NodeType == ExpressionType.Constant) |
|
|
if (item.NodeType == ExpressionType.Constant || (item is MemberExpression) && ((MemberExpression)item).Expression.NodeType == ExpressionType.Constant) |
|
|
{ |
|
|
{ |
|
|
base.Expression = item; |
|
|
base.Expression = item; |
|
|
base.Start(); |
|
|
base.Start(); |
|
|
string parameterName = this.Context.SqlParameterKeyWord + "constant" + i; |
|
|
string parameterName = this.Context.SqlParameterKeyWord + "constant" + i; |
|
|
parameter.Context.Result.Append(parameterName); |
|
|
parameter.Context.Result.Append(base.Context.GetAsString(memberName, parameterName)); |
|
|
this.Context.Parameters.Add(new SugarParameter(parameterName, parameter.CommonTempData)); |
|
|
this.Context.Parameters.Add(new SugarParameter(parameterName, parameter.CommonTempData)); |
|
|
} |
|
|
} |
|
|
else if (item is MemberExpression) |
|
|
else if (item is MemberExpression) |
|
|
{ |
|
|
{ |
|
|
base.Expression = memberAssignment.Expression; |
|
|
if (base.Context.Result.IsLockCurrentParameter == false) |
|
|
base.Start(); |
|
|
{ |
|
|
|
|
|
base.Context.Result.CurrentParameter = parameter; |
|
|
|
|
|
base.Context.Result.IsLockCurrentParameter = true; |
|
|
|
|
|
parameter.IsAppendTempDate(); |
|
|
|
|
|
base.Expression = item; |
|
|
|
|
|
base.Start(); |
|
|
|
|
|
parameter.IsAppendResult(); |
|
|
|
|
|
base.Context.Result.Append(base.Context.GetAsString(memberName, parameter.CommonTempData.ObjToString())); |
|
|
|
|
|
base.Context.Result.CurrentParameter = null; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
else if (item is BinaryExpression) |
|
|
else if (item is BinaryExpression) |
|
|
{ |
|
|
{ |
|
|
base.Expression = item; |
|
|
if (base.Context.Result.IsLockCurrentParameter == false) |
|
|
parameter.CommonTempData = "simple"; |
|
|
{ |
|
|
base.Start(); |
|
|
base.Context.Result.CurrentParameter = parameter; |
|
|
parameter.CommonTempData = null; |
|
|
base.Context.Result.IsLockCurrentParameter = true; |
|
|
|
|
|
parameter.IsAppendTempDate(); |
|
|
|
|
|
base.Expression = item; |
|
|
|
|
|
parameter.CommonTempData = "simple"; |
|
|
|
|
|
base.Start(); |
|
|
|
|
|
parameter.CommonTempData = null; |
|
|
|
|
|
parameter.IsAppendResult(); |
|
|
|
|
|
base.Context.Result.Append(base.Context.GetAsString(memberName, parameter.CommonTempData.ObjToString())); |
|
|
|
|
|
base.Context.Result.CurrentParameter = null; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|