【发布时间】:2011-04-07 20:42:29
【问题描述】:
我需要使用 NHibernate QueryOver 来进行休闲查询。但我的列表有问题。
select * from contact where CountryId = 'xxx' and ContactTypeId in ('aaa', 'bbb')
价值观是 Guid 的。我有一个 List(),其中包含 ContactTypeId (contactTypes) 的 Guid
我已经尝试过 - 但这不起作用:
var query = contactRepository.GetAllOver()
.Where(x => x.Country != null && x.Country.Id == countryId)
.WhereRestrictionOn(x => x.ContactType.Id).IsInG(contactTypes);
我希望有人能给我提示如何使用 QueryOver 编写此内容。
【问题讨论】:
-
AndRestrictionOn(p => p.ContactType.Id).IsInG
(GuidList) 你得到的错误是什么?
标签: c# sql nhibernate queryover