mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-30 04:45:54 +08:00
Synchronization code
This commit is contained in:
parent
b91f91e6b3
commit
ab2b011d06
@ -40,6 +40,27 @@ namespace SqlSugar
|
||||
parameter.Context.Result.Append(this.Context.GetAsString2(asName, GetNewExpressionValue(childExpression)));
|
||||
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.Start();
|
||||
if (ExpressionTool.GetMethodName(item) == "MappingColumn")
|
||||
|
@ -60,6 +60,10 @@ namespace SqlSugar
|
||||
{
|
||||
addValue = Convert.ToDouble(addValue + "").ToString(valueFomatInfo.Format);
|
||||
}
|
||||
else if (valueFomatInfo.TypeString == "Enum")
|
||||
{
|
||||
addValue =ChangeType2( addValue,valueFomatInfo.Type)?.ToString();
|
||||
}
|
||||
}
|
||||
return addValue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user