【发布时间】:2011-06-13 20:08:44
【问题描述】:
好吧,我输了这个。我有一个看起来像这样的 NHibernate 查询
var subQuery = QueryOver.Of<Lead>()
.Where(x => x.Client == user.Client)
.And(x => x.LeadType == leadType && x.LeadType != LeadTypeEnum.Self)
.Select(Projections.Distinct(Projections.Id()));
我用这个
var query = Session.QueryOver<Lead>()
.WithSubquery.WhereProperty(x => x.Id).In(subQuery);
这会产生我需要的东西
Where lead.id in (select Id from .......)
但是,我需要添加另一个子查询。很容易像上面那样做,但我需要这个来产生以下内容
Where lead.id in (select id from .....)
or lead.id in (select id from .......)
问题是我总是得到以下结果
Where lead.id in (select id from .....)
and lead.id in (select id from .......)
有人可以指出我正确的方向以获取或请
【问题讨论】:
标签: nhibernate queryover