我需要获取一些信息,但我是 NHibernate 的新手
我有这样的课程:
Person
Id
IdAddress
Address
Address
Id
IdCity
City
IdNeighborhood
Neighborhood
和班级
City
Neighborhood
我需要所有带有邻居 ID 的地址,这段代码是我搜索信息的地方,但这里只能获取城市:
using(var session = openSession()){
var q = session.Query<Person>(a => Id == IdSearch)
.Fetch(a => a.Address)
.ThenFetch(a => a.City)
.ToList();
session.Clear();
}
我怎样才能获得邻里信息?
天涯尽头无女友
相关分类