mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Update unit error
This commit is contained in:
parent
3558b3be4d
commit
5bd21e81e4
@ -15,14 +15,36 @@ namespace OrmTest
|
||||
.BulkMerge(new List<UnitaafdsTest>() { new UnitaafdsTest() { Id=Guid.NewGuid()
|
||||
, CreateTime=DateTime.Now, Name="a"} });
|
||||
var list=db.Queryable<UnitaafdsTest>().ToList();
|
||||
if (list[0].Name != "a") { throw new Exception("unit error"); }
|
||||
list[0].Name = "j";
|
||||
var count2 = db.Fastest<UnitaafdsTest>()
|
||||
.BulkMerge(list);
|
||||
var list2 = db.Queryable<UnitaafdsTest>().ToList();
|
||||
if (list2[0].Name != "j"|| count2!=1) { throw new Exception("unit error"); }
|
||||
list2.Add(new UnitaafdsTest()
|
||||
{
|
||||
Id = Guid.NewGuid() ,
|
||||
CreateTime = DateTime.Now,
|
||||
Name = "a"
|
||||
});
|
||||
list2.Add(new UnitaafdsTest()
|
||||
{
|
||||
Id = Guid.NewGuid() ,
|
||||
CreateTime = DateTime.Now,
|
||||
Name = "a"
|
||||
});
|
||||
db.Fastest<UnitaafdsTest>()
|
||||
.BulkMerge(list2);
|
||||
var count3 = db.Queryable<UnitaafdsTest>()
|
||||
.Count();
|
||||
if (count3 != 3)
|
||||
{
|
||||
throw new Exception("unit error");
|
||||
}
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
db.Fastest<UnitaafdsTest>()
|
||||
.BulkMerge(list);
|
||||
.BulkMerge(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user