mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-15 23:13:42 +08:00
Add unit test
This commit is contained in:
parent
e7396f2bc3
commit
e17c55e231
@ -96,6 +96,7 @@ namespace OrmTest
|
|||||||
|
|
||||||
Check.Exception(list3333.Select(x=>x.SchoolA).SelectMany(x=>x.TeacherList).Any(it=>it.Id<=2), "unit error");
|
Check.Exception(list3333.Select(x=>x.SchoolA).SelectMany(x=>x.TeacherList).Any(it=>it.Id<=2), "unit error");
|
||||||
|
|
||||||
|
|
||||||
var list3 = db.Queryable<StudentA>()
|
var list3 = db.Queryable<StudentA>()
|
||||||
.Includes(x => x.SchoolA, x => x.RoomList)//2个参数就是 then Include
|
.Includes(x => x.SchoolA, x => x.RoomList)//2个参数就是 then Include
|
||||||
.Includes(x => x.SchoolA, x => x.TeacherList)//2个参数就是 then Include
|
.Includes(x => x.SchoolA, x => x.TeacherList)//2个参数就是 then Include
|
||||||
@ -104,6 +105,19 @@ namespace OrmTest
|
|||||||
.Where(x => x.SchoolA.School_Name == "北大")
|
.Where(x => x.SchoolA.School_Name == "北大")
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
List<IConditionalModel> conditionals = new List<IConditionalModel>();
|
||||||
|
conditionals.Add(new ConditionalModel() {
|
||||||
|
FieldName="name",
|
||||||
|
ConditionalType=ConditionalType.Equal,
|
||||||
|
FieldValue="1"
|
||||||
|
});
|
||||||
|
var list3_0 = db.Queryable<StudentA>()
|
||||||
|
.Includes(x => x.Books.Select(z => new BookA() { Names = z.Names }).ToList())
|
||||||
|
.Where(x => x.Books.Any(conditionals))
|
||||||
|
.Where(x => x.SchoolA.School_Name == "北大")
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var list3_1 = db.Queryable<StudentA>()
|
var list3_1 = db.Queryable<StudentA>()
|
||||||
.Includes(x => x.Books.MappingField(z=>z.Names,()=>x.Name).ToList())
|
.Includes(x => x.Books.MappingField(z=>z.Names,()=>x.Name).ToList())
|
||||||
|
Loading…
Reference in New Issue
Block a user