mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-02-27 16:50:33 +08:00
-
This commit is contained in:
@@ -23,6 +23,7 @@ namespace OrmTest.UnitTest
|
||||
{
|
||||
|
||||
//Native methods
|
||||
ExtendContainsArray();
|
||||
ConvetToString();
|
||||
ExtendToString();
|
||||
ExtendSubstring();
|
||||
@@ -416,6 +417,16 @@ namespace OrmTest.UnitTest
|
||||
}, "Contains error");
|
||||
}
|
||||
|
||||
private void ExtendContainsArray() {
|
||||
string[] array = new string[] { "1", "2" };
|
||||
Expression<Func<Student, bool>> exp = it => array.Contains(it.Name);
|
||||
SqlServerExpressionContext expContext = new SqlServerExpressionContext();
|
||||
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
|
||||
var value = expContext.Result.GetString();
|
||||
var pars = expContext.Parameters;
|
||||
base.Check(value, null, " ([Name] IN ('1','2')) ", null, "Contains2 error");
|
||||
}
|
||||
|
||||
private void ContainsArray()
|
||||
{
|
||||
string[] array = new string[] { "1", "2" };
|
||||
|
||||
Reference in New Issue
Block a user