The following LINQ to NHibernate (using NHibernate 3.0) results in a System.InvalidOperationException being thrown with the message "The binary operator Equal is not defined for the types 'System.Collections.Generic.IList`1[System.Int32]' and 'System.Int32'"
public IEnumerable<ProjectSummary> GetProjects( IList<int> clients )
{
using ( var session = _sessionManager.OpenSession() )
{
var q = from p in session.Query<Project>()
where clients.Contains( p.Client.Id )
select new ProjectSummary()
{
ProjectId = p.Id,
Active = p.Active,
ClientId = p.Client.Id,
Name = p.Name
};
return q.ToList();
}
}