mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 10:08:19 +08:00
Expression bool bug
This commit is contained in:
@@ -369,6 +369,10 @@ namespace OrmTest.Demo
|
||||
var test4 = db.Queryable<DataTestInfo2>().Select(it => new { b=it.Bool1 }).ToSql();
|
||||
DateTime? result = DateTime.Now;
|
||||
var test5 = db.Queryable<Student>().Where(it=>it.CreateTime> result.Value.Date).ToList();
|
||||
|
||||
var test6 = db.Queryable<DataTestInfo2>().Where(it => SqlFunc.HasValue(it.Bool2)==true && SqlFunc.HasValue(it.Bool2)==true).ToList();
|
||||
var test7 = db.Queryable<DataTestInfo2>().Where(it => SqlFunc.HasValue(it.Bool1) && SqlFunc.HasValue(it.Bool1)).ToList();
|
||||
var test8 = db.Queryable<Student>().Where(it => SqlFunc.HasValue(it.SchoolId) && SqlFunc.HasValue(it.SchoolId)).ToList();
|
||||
}
|
||||
public static void Page()
|
||||
{
|
||||
|
@@ -242,7 +242,7 @@ namespace SqlSugar
|
||||
model.Args.AddRange(appendArgs);
|
||||
}
|
||||
var methodValue = GetMethodValue(name, model);
|
||||
if (parameter.BaseExpression is BinaryExpression && parameter.OppsiteExpression.Type == UtilConstants.BoolType&&name=="HasValue"&&!(parameter.OppsiteExpression is BinaryExpression)) {
|
||||
if (parameter.BaseExpression is BinaryExpression && parameter.OppsiteExpression.Type == UtilConstants.BoolType&&name=="HasValue"&&!(parameter.OppsiteExpression is BinaryExpression)&& !(parameter.OppsiteExpression is MethodCallExpression && parameter.OppsiteExpression.Type == UtilConstants.BoolType)) {
|
||||
methodValue = this.Context.DbMehtods.CaseWhen(new List<KeyValuePair<string, string>>() {
|
||||
new KeyValuePair<string, string>("IF",methodValue.ObjToString()),
|
||||
new KeyValuePair<string, string>("Return","1"),
|
||||
|
Reference in New Issue
Block a user