Object Structure: A house has many rooms. A room has many tables. A table has many vases (on it).
House > 会议室;桌椅;瓦西。
我愿利用Join QueryOver在某个房屋中选择所有有红色的血管表。
我认为这是:
var v = session.QueryOver<House>()
.Where(x => x.ID == HouseID)
.JoinQueryOver<Room>(x => x.Rooms)
.JoinQueryOver<Table>(x => x.Tables)
.JoinQueryOver<Vase>(x => x.Vases)
.Where(x => x.Color == "Red")
.SingleOrDefault<House>();
这是我尝试的一种做法(许多失败者)。 我并不真的想要下议院和会议厅。
最后,我看一看一张桌子清单(某个房屋),收集瓦西(红色)的表格。
得到帮助!
<><>Edit>/strong>
与此类似:
var v = session.QueryOver<Table>()
.Where(x => x.Room.House.ID == HouseID) // this Where won t work.
.JoinQueryOver<Vase>(x => x.Vases)
.Where(x => x.Color == "Red")
.List().ToList();