2010-07-20 33 views
4

看來,一個在子句不能使用LINQ 3.0(主幹)正常工作NHibernate的LINQ的3 IN子句

我嘗試以下操作:

var l = session.Query<MyClass>.Where(p => searchGroups.Contains(p.ID)).Select(r=>r); 

我得到那個說

the Binary operator for \"System.Collections.Generic.ICollection`1[System.Int32]\" and \"System.Int32 is not defined 
異常

使用LINQ 1.0能夠正常工作

var l = session.Linq<MyClass>.Where(p => searchGroups.Contains(p.ID)).Select(r=>r); 

我應該使用與新的Linq版本不同的東西嗎?或者它只是一個錯誤?

回答

0

這是一個錯誤。

如果你想使用NHibernate.Linq,我建議你升級到NHibernate 3.2,它就像一個魅力。

NHibernate 3.0 LINQ提供程序與以前的版本是分開的......