This commit is contained in:
sunkaixuan
2017-01-30 18:17:55 +08:00
parent 0e9431ce4b
commit 483145f982
3 changed files with 26 additions and 3 deletions

View File

@@ -24,6 +24,7 @@ namespace OrmTest.ExpressionTest
StringIsNullOrEmpty();
StringIsNullOrEmpty2();
StringIsNullOrEmpty3();
StringIsNullOrEmpty4();
}
base.End("Method Test");
}
@@ -64,6 +65,20 @@ namespace OrmTest.ExpressionTest
new SugarParameter("@Id0",2)
}, "StringIsNullOrEmpty3");
}
private void StringIsNullOrEmpty4()
{
WhereConst.name = "xx";
Expression<Func<Student, bool>> exp = it => 2 == it.Id || NBORM.IsNullOrEmpty(WhereConst.name); ;
SqlServerExpressionContext expContext = new SqlServerExpressionContext(exp, ResolveExpressType.WhereSingle);
expContext.Resolve();
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, "(( @Id0 = Id ) OR ( @MethodCost1='' OR @MethodCost1 IS NULL ))", new List<SugarParameter>() {
new SugarParameter("@MethodCost1","xx"),
new SugarParameter("@Id0",2)
}, "StringIsNullOrEmpty4");
}
}
}