Update exp to sql

This commit is contained in:
sunkaixuna 2022-01-15 17:28:59 +08:00
parent e5d91f44bf
commit d06cb08e0d
2 changed files with 12 additions and 1 deletions

View File

@ -96,6 +96,12 @@ namespace OrmTest
}).ToSql(); }).ToSql();
UValidate.Check(x.Key, "SELECT [a] AS [a] FROM [BoolTest2] ", "Queryable"); UValidate.Check(x.Key, "SELECT [a] AS [a] FROM [BoolTest2] ", "Queryable");
Db.CodeFirst.InitTables<BoolTest3>();
var blist3= Db.Queryable<BoolTest3>().Select(it => new BoolTest3()
{
a = string.IsNullOrEmpty(it.Name)
}).ToList();
var db = Db; var db = Db;
db.CodeFirst.InitTables<UserInfo, UserIpRuleInfo>(); db.CodeFirst.InitTables<UserInfo, UserIpRuleInfo>();
db.Deleteable<UserInfo>().ExecuteCommand(); db.Deleteable<UserInfo>().ExecuteCommand();
@ -519,4 +525,9 @@ namespace OrmTest
{ {
public bool? a { get; set; } public bool? a { get; set; }
} }
public class BoolTest3
{
public bool? a { get; set; }
public string Name { get; set; }
}
} }

View File

@ -483,7 +483,7 @@ namespace SqlSugar
} }
} }
} }
else if (item.Type == UtilConstants.BoolType && item is MethodCallExpression && (item as MethodCallExpression).Method.Name == "Any"&&IsSubMethod(item as MethodCallExpression)) else if (item.Type == UtilConstants.BoolType && item is MethodCallExpression)
{ {
this.Expression = item; this.Expression = item;
this.Start(); this.Start();