mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-02-25 04:27:14 +08:00
Update .net
This commit is contained in:
@@ -477,19 +477,19 @@ namespace SqlSugar
|
||||
{
|
||||
asName = GetAsNameAndShortName(item, shortName, property);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
asName = GetAsName(item, shortName, property);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (item.Type == UtilConstants.BoolType && item is MethodCallExpression)
|
||||
else if (item.Type == UtilConstants.BoolType && item is MethodCallExpression && IsNotCaseExpression(item))
|
||||
{
|
||||
this.Expression = item;
|
||||
this.Start();
|
||||
var sql= this.Context.DbMehtods.IIF(new MethodCallExpressionModel()
|
||||
{
|
||||
Args=new List<MethodCallExpressionArgs>() {
|
||||
Args=new List<MethodCallExpressionArgs>() {
|
||||
new MethodCallExpressionArgs() {
|
||||
IsMember=true,
|
||||
MemberName=parameter.CommonTempData.ObjToString()
|
||||
@@ -518,6 +518,22 @@ namespace SqlSugar
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsNotCaseExpression(Expression item)
|
||||
{
|
||||
if ((item as MethodCallExpression).Method.Name == "IIF")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if ((item as MethodCallExpression).Method.Name == "End"&&item.ToString().Contains("IF("))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private Dictionary<string, string> GetMappingColumns(Expression currentExpression)
|
||||
{
|
||||
Dictionary<string, string> result = new Dictionary<string, string>();
|
||||
|
||||
Reference in New Issue
Block a user