mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Update pgsql return pklist
This commit is contained in:
parent
c73bc9ce81
commit
aae91c90a0
@ -47,6 +47,14 @@ namespace OrmTest
|
|||||||
var ids2 = db.Insertable(new List<UnitIdentity01>() { new UnitIdentity01() { Name = "c" }, new UnitIdentity01() { Name = "c" } }).ExecuteReturnPkList<int>();
|
var ids2 = db.Insertable(new List<UnitIdentity01>() { new UnitIdentity01() { Name = "c" }, new UnitIdentity01() { Name = "c" } }).ExecuteReturnPkList<int>();
|
||||||
if (ids2.Count(z => z > 0) != 2) { throw new Exception("unit error"); }
|
if (ids2.Count(z => z > 0) != 2) { throw new Exception("unit error"); }
|
||||||
if (db.Queryable<UnitIdentity01>().In(ids2).Count() != 2) { throw new Exception("unit error"); }
|
if (db.Queryable<UnitIdentity01>().In(ids2).Count() != 2) { throw new Exception("unit error"); }
|
||||||
|
var list = new List<UnitIdentity01>();
|
||||||
|
for (int i = 0; i < 1000; i++)
|
||||||
|
{
|
||||||
|
list.Add(new UnitIdentity01() { Name = "a" });
|
||||||
|
}
|
||||||
|
var ids3 = db.Insertable(list).ExecuteReturnPkList<int>();
|
||||||
|
if (db.Queryable<UnitIdentity01>().In(ids3).Count() != 1000) { throw new Exception("unit error"); }
|
||||||
|
db.DbMaintenance.TruncateTable<UnitIdentity01>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UnitGuid123
|
public class UnitGuid123
|
||||||
|
@ -56,6 +56,10 @@ namespace SqlSugar
|
|||||||
StringBuilder batchInsetrSql = new StringBuilder();
|
StringBuilder batchInsetrSql = new StringBuilder();
|
||||||
int pageSize = 200;
|
int pageSize = 200;
|
||||||
int pageIndex = 1;
|
int pageIndex = 1;
|
||||||
|
if (IsNoPage&&IsReturnPkList)
|
||||||
|
{
|
||||||
|
pageSize = groupList.Count;
|
||||||
|
}
|
||||||
int totalRecord = groupList.Count;
|
int totalRecord = groupList.Count;
|
||||||
int pageCount = (totalRecord + pageSize - 1) / pageSize;
|
int pageCount = (totalRecord + pageSize - 1) / pageSize;
|
||||||
while (pageCount >= pageIndex)
|
while (pageCount >= pageIndex)
|
||||||
|
Loading…
Reference in New Issue
Block a user