I understand that in NHibernate LINQ, you need to have the fetches at the end of your code but how would you filter on something that is loaded via a ThenFetch
?
Here is an example
IEnumerable<Project> list = Session.Query<Project>()
.FetchMany(r => r.ProjectSponsors)
.ThenFetch(r => r.Sponsor)
.Where(r => !r.Name == "Joe");
this above doens't work as 开发者_JS百科it throws a NotSupportedException
.
Any ideas on the right way to implement the above query?
No currently it isn't. Fetch
can only be used as last statement.
精彩评论