好吧,我输了这个。我有一个看起来像这样的 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 .......)
有人可以指出我正确的方向来获得或请