I have the following code that works as part of a Fluent NHibernate request
session.Query<Project>()
.Where(r=>r.IsActive)
.FetchMany(r => r.ProjectDependencies)
.ThenFetch(r => r.DependencyProject)
.ThenFetch(r => r.Owner)
The above code works fine, but the problem is that I want to join and load additional “attributes” that connect to the object DependencyProjectexcept the owner (as mentioned above). So I want to do something like this:
session.Query<Project>()
.Where(r=>r.IsActive)
.FetchMany(r => r.ProjectDependencies)
.ThenFetch(r => r.DependencyProject)
.ThenFetch(r => r.Owner)
.AndAlsoFetch(r=>r.Status)
Or maybe so:
session.Query<Project>()
.Where(r=>r.IsActive)
.FetchMany(r => r.ProjectDependencies)
.ThenFetch(r => r.DependencyProject)
.ThenFetch(r => r.Owner && r.Status)
Is there a way to make multiple selections of the properties of an object that is already being entered as part ThenFetch?
leora source
share