mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-24 07:22:57 +08:00
Add unit test
This commit is contained in:
parent
344dd120c2
commit
035776749a
@ -59,6 +59,19 @@ namespace OrmTest
|
|||||||
.Where(x => x.SchoolA.SchoolName == "北大")
|
.Where(x => x.SchoolA.SchoolName == "北大")
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
var list2222= db.Queryable<StudentA>()
|
||||||
|
.Includes(x => x.SchoolA, x => x.RoomList)//2个参数就是 then Include
|
||||||
|
.Includes(x => x.Books)
|
||||||
|
.Select(it=>new {
|
||||||
|
a1=it.SchoolA,
|
||||||
|
a2=it.Books
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
if (list2222.First().a1?.RoomList?.Any() != true || !list2222.First().a2.Any())
|
||||||
|
{
|
||||||
|
throw new Exception("unit error");
|
||||||
|
}
|
||||||
|
|
||||||
db.QueryFilter.AddTableFilter<BookA>(x => x.Name == "a");
|
db.QueryFilter.AddTableFilter<BookA>(x => x.Name == "a");
|
||||||
var list22 = db.Queryable<StudentA>()
|
var list22 = db.Queryable<StudentA>()
|
||||||
|
Loading…
Reference in New Issue
Block a user