Cacheable(), FetchMany() and ToFuture() in same NHibernate Linq query
问题 Having a situation similar to the following example: 1 parent entity Employee having 2 child collections: Addresses and Phones I need to retrieve in a single roundtrip all employees with their Addresses and Phones initialized and also cache the query that achieves that in level 2 cache using Cacheable() . Using: var baseQuery = session .Query<Employee>() .Cacheable(); baseQuery .FetchMany(e => e.Addresses) .ToFuture(); var list = baseQuery .FetchMany(e => e.Phones) .ToFuture() .ToList();