mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-15 05:13:27 +08:00
Update exp to sql
This commit is contained in:
parent
6942cddfee
commit
b3921d3f22
@ -130,6 +130,14 @@ namespace SqlSugar
|
|||||||
return newExp;
|
return newExp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string GetMethodName(Expression expression)
|
||||||
|
{
|
||||||
|
if (expression is MethodCallExpression)
|
||||||
|
{
|
||||||
|
return (expression as MethodCallExpression).Method.Name;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public static Type GetMemberInfoType(MemberInfo member)
|
public static Type GetMemberInfoType(MemberInfo member)
|
||||||
{
|
{
|
||||||
|
@ -530,6 +530,11 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (IsExtSqlFuncObj(item))
|
||||||
|
{
|
||||||
|
var value = GetNewExpressionValue(item);
|
||||||
|
parameter.Context.Result.Append($" {value} AS {asName} ");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
asName = GetAsNameResolveAnObject(parameter, item, asName, isSameType);
|
asName = GetAsNameResolveAnObject(parameter, item, asName, isSameType);
|
||||||
@ -744,6 +749,11 @@ namespace SqlSugar
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Validate
|
#region Validate
|
||||||
|
|
||||||
|
private bool IsExtSqlFuncObj(Expression item)
|
||||||
|
{
|
||||||
|
return this.Context.SqlFuncServices != null && item is MethodCallExpression && this.Context.SqlFuncServices.Any(it => it.UniqueMethodName == ExpressionTool.GetMethodName(item));
|
||||||
|
}
|
||||||
private bool IsNullValue(ExpressionParameter parameter, object value)
|
private bool IsNullValue(ExpressionParameter parameter, object value)
|
||||||
{
|
{
|
||||||
return value == null
|
return value == null
|
||||||
|
Loading…
Reference in New Issue
Block a user