mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 13:06:50 +08:00
Add unit test
This commit is contained in:
parent
89614f87d8
commit
d8264000ba
@ -31,6 +31,7 @@ namespace OrmTest
|
|||||||
}
|
}
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
|
UCustom024.Init();
|
||||||
UCustom24.Init();
|
UCustom24.Init();
|
||||||
UCustom20.Init();
|
UCustom20.Init();
|
||||||
UTran2.Init();
|
UTran2.Init();
|
||||||
|
@ -17,10 +17,24 @@ namespace OrmTest
|
|||||||
var list=db.Queryable<UnitNewP>().Take(2).ToList();
|
var list=db.Queryable<UnitNewP>().Take(2).ToList();
|
||||||
db.Updateable(list).ExecuteCommand();
|
db.Updateable(list).ExecuteCommand();
|
||||||
db.Deleteable(list).ExecuteCommand();
|
db.Deleteable(list).ExecuteCommand();
|
||||||
|
var p = new TestModel2();
|
||||||
|
db.Queryable<Order>().Where(z => z.Id != p.Id).ToList();
|
||||||
|
var p2 = new Order();
|
||||||
|
db.Queryable<Order>().Where(z => z.Id != p2.Id).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class TestModel
|
||||||
|
{
|
||||||
|
public virtual long? Id { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TestModel2 : TestModel
|
||||||
|
{
|
||||||
|
// 关键就是这个地方
|
||||||
|
public new long Id { get; set; }
|
||||||
|
}
|
||||||
public class UnitNewP: UnitBaseP
|
public class UnitNewP: UnitBaseP
|
||||||
{
|
{
|
||||||
[SqlSugar.SugarColumn(IsPrimaryKey =true)]
|
[SqlSugar.SugarColumn(IsPrimaryKey =true)]
|
||||||
|
Loading…
Reference in New Issue
Block a user