mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-12-21 19:09:57 +08:00
Synchronization code
This commit is contained in:
@@ -40,6 +40,27 @@ namespace SqlSugar
|
|||||||
parameter.Context.Result.Append(this.Context.GetAsString2(asName, GetNewExpressionValue(childExpression)));
|
parameter.Context.Result.Append(this.Context.GetAsString2(asName, GetNewExpressionValue(childExpression)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else if (ExpressionTool.GetMethodName(item) == "ToString"
|
||||||
|
&& (item as MethodCallExpression)?.Arguments?.Count() == 0
|
||||||
|
&& (item as MethodCallExpression)?.Object?.Type?.IsEnum==true
|
||||||
|
&& this.Context?.SugarContext?.QueryBuilder != null)
|
||||||
|
{
|
||||||
|
var childExpression = (item as MethodCallExpression)?.Object;
|
||||||
|
var type = childExpression.Type;
|
||||||
|
if (this.Context.SugarContext.QueryBuilder.QueryableFormats == null)
|
||||||
|
{
|
||||||
|
this.Context.SugarContext.QueryBuilder.QueryableFormats = new List<QueryableFormat>();
|
||||||
|
}
|
||||||
|
this.Context.SugarContext.QueryBuilder.QueryableFormats.Add(new QueryableFormat()
|
||||||
|
{
|
||||||
|
PropertyName = asName,
|
||||||
|
Type = type,
|
||||||
|
TypeString = "Enum",
|
||||||
|
MethodName = "ToString"
|
||||||
|
});
|
||||||
|
parameter.Context.Result.Append(this.Context.GetAsString2(asName, GetNewExpressionValue(childExpression)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.Expression = item;
|
this.Expression = item;
|
||||||
this.Start();
|
this.Start();
|
||||||
if (ExpressionTool.GetMethodName(item) == "MappingColumn")
|
if (ExpressionTool.GetMethodName(item) == "MappingColumn")
|
||||||
|
|||||||
@@ -60,6 +60,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
addValue = Convert.ToDouble(addValue + "").ToString(valueFomatInfo.Format);
|
addValue = Convert.ToDouble(addValue + "").ToString(valueFomatInfo.Format);
|
||||||
}
|
}
|
||||||
|
else if (valueFomatInfo.TypeString == "Enum")
|
||||||
|
{
|
||||||
|
addValue =ChangeType2( addValue,valueFomatInfo.Type)?.ToString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return addValue;
|
return addValue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user