|
|
@ -21,13 +21,30 @@ namespace OrmTest.ExpressionTest |
|
|
|
base.Begin(); |
|
|
|
for (int i = 0; i < base.Count; i++) |
|
|
|
{ |
|
|
|
#region StringIsNullOrEmpty
|
|
|
|
StringIsNullOrEmpty(); |
|
|
|
StringIsNullOrEmpty2(); |
|
|
|
StringIsNullOrEmpty3(); |
|
|
|
StringIsNullOrEmpty4(); |
|
|
|
ToUpper(); |
|
|
|
#endregion
|
|
|
|
} |
|
|
|
base.End("Method Test"); |
|
|
|
} |
|
|
|
|
|
|
|
private void ToUpper() |
|
|
|
{ |
|
|
|
Expression<Func<Student, bool>> exp = it =>"a"== NBORM.ToLower(it.Id) ; |
|
|
|
SqlServerExpressionContext expContext = new SqlServerExpressionContext(exp, ResolveExpressType.WhereSingle); |
|
|
|
expContext.Resolve(); |
|
|
|
var value = expContext.Result.GetString(); |
|
|
|
var pars = expContext.Parameters; |
|
|
|
base.Check(value, pars, "(( Id > @Id0 ) OR ( Id='' OR Id IS NULL ))", new List<SugarParameter>() { |
|
|
|
new SugarParameter("@Id0",2) |
|
|
|
}, "StringIsNullOrEmpty"); |
|
|
|
} |
|
|
|
|
|
|
|
#region StringIsNullOrEmpty
|
|
|
|
private void StringIsNullOrEmpty() |
|
|
|
{ |
|
|
|
Expression<Func<Student, bool>> exp = it => it.Id > 2 || NBORM.IsNullOrEmpty(it.Id); ; |
|
|
@ -39,7 +56,6 @@ namespace OrmTest.ExpressionTest |
|
|
|
new SugarParameter("@Id0",2) |
|
|
|
}, "StringIsNullOrEmpty"); |
|
|
|
} |
|
|
|
|
|
|
|
private void StringIsNullOrEmpty2() |
|
|
|
{ |
|
|
|
Expression<Func<Student, bool>> exp = it => 2 == it.Id || NBORM.IsNullOrEmpty(true); ; |
|
|
@ -65,7 +81,6 @@ namespace OrmTest.ExpressionTest |
|
|
|
new SugarParameter("@Id0",2) |
|
|
|
}, "StringIsNullOrEmpty3"); |
|
|
|
} |
|
|
|
|
|
|
|
private void StringIsNullOrEmpty4() |
|
|
|
{ |
|
|
|
WhereConst.name = "xx"; |
|
|
@ -79,6 +94,7 @@ namespace OrmTest.ExpressionTest |
|
|
|
new SugarParameter("@Id0",2) |
|
|
|
}, "StringIsNullOrEmpty4"); |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|