Browse Source

-

pull/12/MERGE
sunkaixuan 8 years ago
parent
commit
0bd7100e75
  1. 7
      OrmTest/UnitTest/Insert.cs

7
OrmTest/UnitTest/Insert.cs

@ -40,19 +40,24 @@ namespace OrmTest.UnitTest
//Use Lock
var s6 =db.Insertable(insertObj).With(SqlWith.UpdLock).ToSql();
//ToSql
var s7= db.Insertable(insertObj).With(SqlWith.UpdLock)
.InsertColumns(it => new { it.Name }).ToSql();
var s8 = db.Insertable(insertObj).Where(true/* Is insert null */, true/*off identity*/).ToSql();
db.IgnoreColumns = new IgnoreComumnList();
db.IgnoreColumns.Add("TestId", "Student");
//Insert List<T>
var insertObjs = new List<Student>();
for (int i = 0; i < 1000; i++)
{
insertObjs.Add(new Student() { Name="name"+i });
}
var s8= db.Insertable(insertObjs.ToArray()).InsertColumns(it=>new{ it.Name}).With(SqlWith.UpdLock).ToSql();
var s9= db.Insertable(insertObjs.ToArray()).InsertColumns(it=>new{ it.Name}).With(SqlWith.UpdLock).ToSql();
}
public SqlSugarClient GetInstance()

Loading…
Cancel
Save