Why Fetch should be the last sentence in a Linq Nhibernate query

Fetch should be the last in the Linq-based Mike Hadlow blog post :

Note that if you want to mix Fetch with other sentences, Fetch should always come last.

So, if Fetch just specifies the selection strategy for the property, why can't I have more sentences after Fetch? N

In one case that I encounter, AsPagination (MVCContrib) is used with Fetch. Because AsPagination is trying to get a counter for the request that Fetch has by adding .Count () to the end.

So, why should the property output strategy be the last sentence in the Linq Nhibernate query expression?

+3
source share
1 answer

I ran into the same problem before I realized what was going on. http://groups.google.com/group/nhibernate-development/browse_thread/thread/b44957841c9416ba

The most likely reason is that it was easier to implement this path, because there was no need to consider the possible conversions (select / group by) that might occur in the request.

NHibernate , . QueryOver, , . , .

():

NHibernate fetchmode. ( NH)

Nhibernate LINQ, .

+2

Source: https://habr.com/ru/post/1782510/


All Articles