nhibernate/nhibernate-core — pull request #66 by hazzik (2012-01-24 17:56:46+00:00)
Title: NH-3032: Linq - Group By with contains inside where clause throws exceptions (regression)

Following query throws exception `System.InvalidOperationException` : The binary operator AndAlso is not defined for the types 'System.Boolean' and 'NHibernate.DomainModel.Northwind.Entities.Supplier'.

```csharp
var result = db.Products
.Where(x => x.Discontinued == true && collection.Contains(x.Supplier))
.GroupBy(x => x.UnitPrice)
.Select(x => new {x.Key, Count = x.Count()})
.ToList();
```

Similar query without AndAlso throws another exception: `NHibernate.HibernateException` : Query Source could not be identified: ItemName = _1, ItemType = NHibernate.DomainModel.Northwind.Entities.Supplier, Expression = from Supplier _1 in value(System.Collections.Generic.List`1[NHibernate.DomainModel.Northwind.Entities.Supplier])

```csharp
var result = db.Products
.Where(x => collection.Contains(x.Supplier))
.GroupBy(x => x.UnitPrice)
.Select(x => new {x.Key, Count = x.Count()})
.ToList();
```

https://nhibernate.jira.com/browse/NH-3032