mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 18:22:23 +08:00
Soupport Int.Parse
This commit is contained in:
@@ -402,6 +402,14 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (name == "Parse" && TempParseType.IsIn(UtilConstants.GuidType))
|
||||||
|
{
|
||||||
|
name = "Equals";
|
||||||
|
}
|
||||||
|
else if(name== "Parse")
|
||||||
|
{
|
||||||
|
name = "To"+TempParseType.Name;
|
||||||
|
}
|
||||||
switch (name)
|
switch (name)
|
||||||
{
|
{
|
||||||
case "IIF":
|
case "IIF":
|
||||||
@@ -526,10 +534,30 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
if (IsExtMethod(expression.Method.Name))
|
if (IsExtMethod(expression.Method.Name))
|
||||||
return true;
|
return true;
|
||||||
|
if (IsParseMethod(expression))
|
||||||
|
return true;
|
||||||
if (expression.Method.ReflectedType().FullName != ExpressionConst.SqlFuncFullName)
|
if (expression.Method.ReflectedType().FullName != ExpressionConst.SqlFuncFullName)
|
||||||
return false;
|
return false;
|
||||||
else
|
else
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
private Type TempParseType;
|
||||||
|
public bool IsParseMethod(MethodCallExpression expression)
|
||||||
|
{
|
||||||
|
if (expression.Method.Name == "Parse"&&expression.Method.DeclaringType.IsIn(
|
||||||
|
UtilConstants.DecType,
|
||||||
|
UtilConstants.DateType,
|
||||||
|
UtilConstants.DobType,
|
||||||
|
UtilConstants.GuidType,
|
||||||
|
UtilConstants.FloatType,
|
||||||
|
UtilConstants.ShortType,
|
||||||
|
UtilConstants.LongType,
|
||||||
|
UtilConstants.IntType))
|
||||||
|
{
|
||||||
|
TempParseType = expression.Method.DeclaringType;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user