Update Demo

This commit is contained in:
sunkaixuan 2019-05-10 20:26:23 +08:00
parent d5e67042ca
commit f0f5c61d41

View File

@ -33,7 +33,7 @@ namespace OrmTest
db.Insertable(new Tree() { Id = 22, Name = "child3", ParentId = 2 }).ExecuteCommand(); db.Insertable(new Tree() { Id = 22, Name = "child3", ParentId = 2 }).ExecuteCommand();
var list=db.Queryable<Tree>() var list=db.Queryable<Tree>()
//parent=(select * from parent where id=it.parent) //parent=(select * from parent where id=it.parentid)
.Mapper(it=>it.Parent,it=>it.ParentId, it=>it.Parent.Id) .Mapper(it=>it.Parent,it=>it.ParentId, it=>it.Parent.Id)
//Child=(select * from parent where ParentId=it.id) //Child=(select * from parent where ParentId=it.id)
.Mapper(it => it.Child, it => it.Id, it => it.Parent.ParentId) .Mapper(it => it.Child, it => it.Id, it => it.Parent.ParentId)