nhibernate/nhibernate-core — pull request #93 by hazzik (2012-04-06 04:10:31+00:00)
Title: NH-3111: Linq incorrect replaces member access expressions with joins in subqueries.

NH when transforms following kinds of queries places join for `ol.Order` into the subquery instead of outer query.

```csharp
var list = (db.OrderLines
.Select(ol => new
{
ol.Discount,
ShipperPhoneNumber = db.Shippers
.Where(sh => sh.ShipperId == ol.Order.Shipper.ShipperId)
.Select(sh => sh.PhoneNumber)
.FirstOrDefault()
})).ToList();
```

I've added check that joins is applied only for the correct query model.

JIRA: https://nhibernate.jira.com/browse/NH-3111