Optimized expression

This commit is contained in:
sunkaixuan
2017-11-13 12:50:55 +08:00
parent fd17ab0b4a
commit fe69079c1b
3 changed files with 17 additions and 3 deletions

View File

@@ -91,7 +91,7 @@ namespace OrmTest.UnitTest
var t4 = db.Queryable<Student, School, School>((st, sc, sc2) => new object[] {
JoinType.Left,st.SchoolId==sc.Id,
JoinType.Left,sc2.Id==sc.Id
}).GroupBy(st => st.Id).Select(st=>st.Id).Count();
}).GroupBy(st => st.Id).Select(st => st.Id).Count();
DateTime? result = DateTime.Now;
var t5 = db.Queryable<Student>().Where(it => it.CreateTime > result.Value.Date).ToSql();
@@ -99,6 +99,13 @@ namespace OrmTest.UnitTest
new List<SugarParameter>() {
new SugarParameter("@Const0",result.Value.Date)
}, t5.Key, t5.Value, "select t5 Error");
db.Ado.IsEnableLogEvent = false;
var t6 = db.Queryable<DataTestInfo2>().Where(it => SqlFunc.HasValue(it.Bool2) == false).ToSql();
base.Check("SELECT [PK],[Bool1],[Bool2],[Text1] FROM [DataTestInfo2] WHERE (( CASE WHEN ( [Bool2]<>'' AND [Bool2] IS NOT NULL ) THEN 1 ELSE 0 END ) = @Const0 )",
new List<SugarParameter>() {
new SugarParameter("@Const0",false)
}, t6.Key, t6.Value, "select t6 Error");
#endregion