mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Add unit test
This commit is contained in:
parent
7d20f06833
commit
4ee7cdf6a2
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
@ -41,13 +42,36 @@ namespace OrmTest
|
||||
{
|
||||
throw new Exception("unit error");
|
||||
}
|
||||
for (int i = 0; i < 1000; i++)
|
||||
for (int i = 0; i < 1; i++)
|
||||
{
|
||||
db.Fastest<UnitaafdsTest>()
|
||||
.BulkMerge(list);
|
||||
}
|
||||
db.CodeFirst.InitTables<TableA>();
|
||||
db.Insertable(new TableA() { key1 = Guid.NewGuid() + "" })
|
||||
.ExecuteCommand();
|
||||
db.Insertable(new TableA() { key1 = Guid.NewGuid() + "" })
|
||||
.ExecuteCommand();
|
||||
var datas = db.Queryable<TableA>().ToList();
|
||||
db.Fastest<TableA>().PageSize(10000).BulkMerge(datas);
|
||||
}
|
||||
}
|
||||
public class TableA
|
||||
{
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public string key1 { get; set; } = "a";
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public string key2 { get; set; } = "b";
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public string key3 { get; set; } = "c";
|
||||
public string str1 { get; set; } = "c";
|
||||
public string str2 { get; set; } = "c";
|
||||
public DateTime? date1 { get; set; } = DateTime.Now;
|
||||
public DateTime? date2 { get; set; } = DateTime.Now;
|
||||
public decimal? num1 { get; set; } = 0;
|
||||
public decimal? num2 { get; set; } = 0;
|
||||
}
|
||||
|
||||
public class UnitaafdsTest
|
||||
{
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true)]
|
||||
|
Loading…
Reference in New Issue
Block a user