Support array parameters

This commit is contained in:
sunkaixuan
2019-01-12 03:30:41 +08:00
parent 45626e7a41
commit f0daf77b32
4 changed files with 43 additions and 1 deletions

View File

@@ -310,6 +310,9 @@ namespace OrmTest.Demo
var t1 = db.Ado.SqlQuery<string>("select 'a'");
var t2 = db.Ado.GetInt("select 1");
var t3 = db.Ado.GetDataTable("select 1 as id");
var t4 = db.Ado.GetScalar("select * from student where id in (@id) ", new { id = new List<int>() { 1, 2, 3 } });
var t5 = db.Ado.GetScalar("select * from student where id in (@id) ", new { id = new int [] { 1, 2, 3 } });
var t6= db.Ado.GetScalar("select * from student where id in (@id) ", new SugarParameter("@id", new int[] { 1, 2, 3 }));
db.Ado.CommitTran();
var t11 = db.Ado.SqlQuery<Student>("select * from student");
//more

View File

@@ -48,7 +48,7 @@ namespace OrmTest.Demo
//Insert List<T>
var insertObjs = new List<Student>();
for (int i = 0; i < 1000; i++)
for (int i = 0; i < 10; i++)
{
insertObjs.Add(new Student() { Name = "name" + i });
}