我正在编写一个nHibernate QueryOver
查询,如果它的子集合没有任何元素,则该查询应排除一个元素。像这样:
session.QueryOver<MyRoot>()
.Inner.JoinAlias(x => x.Child, () => child)
.Where(() => child.Collection.Any()) //I've tried with .Count > 0 as well;
.Future();
我正在disjunction
中提前构建WHERE的谓词,这只是出于说明目的。
有什么想法吗?