Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果一个实体与另一个实体的关系映射为 Lazy=False,但是对于某个函数,我需要将它们全部 Lazily 获取,这可以在运行时执行吗?
不,你不能。正如评论者指出的那样,您可以将其映射为惰性并急切地获取,但不能反过来。
Fetch即在 LINQ 中,您可以使用/ FetchMany/ ThenFetch/急切地获取关系ThenFetchMany:
Fetch
FetchMany
ThenFetch
ThenFetchMany
session.Query<Parent>() .Where(x => x.Name == "Ruba") .FetchMany(x => x.Children) .ThenFetch(x => x.SomethingMore);