mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Update unit test
This commit is contained in:
parent
31aae95883
commit
313d5c0101
@ -1,5 +1,4 @@
|
|||||||
using SqlSeverTest.UnitTest;
|
using SqlSugar;
|
||||||
using SqlSugar;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using OrmTest;
|
using OrmTest;
|
||||||
|
|
||||||
namespace SqlSeverTest.UnitTest
|
namespace OrmTest
|
||||||
{
|
{
|
||||||
internal class UnitBulkMerge
|
internal class UnitBulkMerge
|
||||||
{
|
{
|
||||||
@ -47,8 +48,25 @@ namespace SqlSeverTest.UnitTest
|
|||||||
db.Fastest<UnitaafdsTest>()
|
db.Fastest<UnitaafdsTest>()
|
||||||
.BulkMerge(list);
|
.BulkMerge(list);
|
||||||
}
|
}
|
||||||
|
db.CodeFirst.InitTables<Unitfadfayy>();
|
||||||
|
db.DbMaintenance.TruncateTable<Unitfadfayy>();
|
||||||
|
List<Unitfadfayy> addItems = new List<Unitfadfayy>();
|
||||||
|
addItems.Add(new Unitfadfayy() { CreateTime = DateTime.Now, Name = "a" });
|
||||||
|
db.Fastest<Unitfadfayy>().BulkMerge(addItems);
|
||||||
|
var list3=db.Queryable<Unitfadfayy>().ToList();
|
||||||
|
list3.First().Name = "j";
|
||||||
|
db.Fastest<Unitfadfayy>().BulkMerge(list3);
|
||||||
|
var list4 = db.Queryable<Unitfadfayy>().ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public class Unitfadfayy
|
||||||
|
{
|
||||||
|
|
||||||
|
[SqlSugar.SugarColumn(IsPrimaryKey = true,IsIdentity =true)]
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
}
|
||||||
public class UnitaafdsTest
|
public class UnitaafdsTest
|
||||||
{
|
{
|
||||||
[SqlSugar.SugarColumn(IsPrimaryKey = true)]
|
[SqlSugar.SugarColumn(IsPrimaryKey = true)]
|
||||||
|
Loading…
Reference in New Issue
Block a user