Update exp to sql

This commit is contained in:
sunkaixuan
2022-04-13 21:10:02 +08:00
parent 53e4891182
commit ca07200bbe
2 changed files with 13 additions and 6 deletions

View File

@@ -86,9 +86,11 @@ namespace OrmTest
db.Insertable(new ABMapping1() { AId=1,BId=1 }).ExecuteCommand();
db.Insertable(new ABMapping1() { AId =2, BId = 1 }).ExecuteCommand();
db.Insertable(new ABMapping1() { AId = 2, BId = 2 }).ExecuteCommand();
var list3= db.Queryable<A1>()
.Includes(x => x.BList)
.Includes(x => x.BList.Where(it=>it.Id==1).ToList())
.Where(x=>x.BList.Any()).ToList();
var list31 = db.Queryable<A1>().Includes(x => x.BList,x=>x.AList).ToList();
db.CodeFirst.InitTables(typeof(Tree1));