0
當我在Linq-to-NHibernate中使用像這樣的子查詢時,出現錯誤「Unhanded expression type 1000」。 This link包含相同的問題,但不提供任何適當的解決方案。Linq-NHibernate子查詢錯誤:未處理的表達式類型1000
有沒有人知道任何解決方案?我使用的是NHibernate 2.1.2。我意識到NH3中的新LINQ提供者有很多改進,但是我擔心我不能使用NHibernate 3,因爲我通過Castle ActiveRecord使用NHibernate。
var innerQuery = from obj1 in ActiveRecordLinq.AsQueryable<TypeA>()
where
obj1.Prop1 == "abc"
select
obj1;
var outerQuery = from obj2 in ActiveRecordLinq.AsQuerable<TypeB>()
where
obj2.Prop2 == "def"
&&
innerQuery.Contains(obj2.TypeAProp)
select
obj2;