Add unit test

This commit is contained in:
sunkaixuan 2022-09-14 21:37:47 +08:00
parent 89614f87d8
commit d8264000ba
2 changed files with 15 additions and 0 deletions

View File

@ -31,6 +31,7 @@ namespace OrmTest
}
public static void Init()
{
UCustom024.Init();
UCustom24.Init();
UCustom20.Init();
UTran2.Init();

View File

@ -17,10 +17,24 @@ namespace OrmTest
var list=db.Queryable<UnitNewP>().Take(2).ToList();
db.Updateable(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
{
[SqlSugar.SugarColumn(IsPrimaryKey =true)]