mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-15 14:04:44 +08:00
Add unit test
This commit is contained in:
parent
47f9d0b304
commit
4a2f11d954
@ -36,6 +36,18 @@ namespace OrmTest
|
|||||||
//导航插入三表数据
|
//导航插入三表数据
|
||||||
db.InsertNav(a).Include(t => t.B).ThenInclude(t => t.C).ExecuteCommand();
|
db.InsertNav(a).Include(t => t.B).ThenInclude(t => t.C).ExecuteCommand();
|
||||||
|
|
||||||
|
|
||||||
|
var list3 = db.Queryable<ClassA>()
|
||||||
|
.Includes(t => t.B, t => t.C).Where(it=>it.B.Any(z=>z.C.Any(s=>s.CId=="a5"))).ToList();
|
||||||
|
|
||||||
|
var list4 = db.Queryable<ClassA>()
|
||||||
|
.Includes(t => t.B, t => t.C).Where(it => it.B.Any(z => z.C.Any(s => s.CId == "c"))).ToList();
|
||||||
|
|
||||||
|
if (list3.Count > 0 || list4.Count == 0)
|
||||||
|
{
|
||||||
|
throw new Exception("unit error");
|
||||||
|
}
|
||||||
|
|
||||||
//修改数据 修改b表id 修改c表对应b表id
|
//修改数据 修改b表id 修改c表对应b表id
|
||||||
b.BId = "bb";
|
b.BId = "bb";
|
||||||
c.BId = "bb";
|
c.BId = "bb";
|
||||||
|
Loading…
Reference in New Issue
Block a user