Hi all.

Question from nh-users 
group https://groups.google.com/d/topic/nhusers/P_BD_5USTbs/discussion

Michael asks about using paging in combination with fetch.

There are two possible solutions from NH side:

1. Warn user that he would have unexpected results because of cartesian 
product and point user that he should split the queries.
2. Convert query to inner subselect with paging and outer with fetch.

So

            var products = db.Products.Take(5).Fetch(x => 
x.OrderLines).ToList();

will be implicit converted to 

            var first5products = db.Products.Take(5);

            var products = db.Products
                .Where(x => first5products.Contains(x))
                .Fetch(x => x.OrderLines)
                .ToList();

What do you think?

Reply via email to