mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-06-28 04:35:29 +08:00
Update exp to sql
This commit is contained in:
parent
c3e1d64cbd
commit
105ba2a697
@ -55,11 +55,10 @@ namespace SqlSugar
|
||||
var item = memberAssignment.Expression;
|
||||
item = ExpressionTool.RemoveConvert(item);
|
||||
//Column IsJson Handler
|
||||
if (memberAssignment.Member.CustomAttributes != null)
|
||||
{
|
||||
var customAttribute = memberAssignment.Member.GetCustomAttribute<SugarColumn>();
|
||||
|
||||
if (customAttribute?.IsJson ?? false)
|
||||
if (entityMaintenance!=null)
|
||||
{
|
||||
EntityColumnInfo columnInfo = entityMaintenance.GetEntityInfo(type).Columns.FirstOrDefault(it => it.PropertyName == memberAssignment.Member.Name);
|
||||
if (columnInfo?.IsJson ?? false)
|
||||
{
|
||||
var paramterValue = ExpressionTool.DynamicInvoke(item);
|
||||
var parameterName = AppendParameter(new SerializeService().SerializeObject(paramterValue));
|
||||
@ -72,6 +71,15 @@ namespace SqlSugar
|
||||
|
||||
continue;
|
||||
}
|
||||
else if (UtilMethods.IsParameterConverter(columnInfo))
|
||||
{
|
||||
var value = ExpressionTool.DynamicInvoke(item);
|
||||
var p=UtilMethods.GetParameterConverter(this.Context.ParameterIndex,this.Context.SugarContext.Context, value, memberAssignment.Expression, columnInfo);
|
||||
this.Context.Result.Append(base.Context.GetEqString(memberName, p.ParameterName));
|
||||
this.Context.ParameterIndex++;
|
||||
this.Context.Parameters.Add(p);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ((item is MemberExpression) && ((MemberExpression)item).Expression == null)
|
||||
|
Loading…
Reference in New Issue
Block a user