开发者

Using NHibernate LINQ, Is it possible to put a .Where() clause after a .ThenFetch()

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜