开发者

NHibernate Criteria Query - Select Distinct

I have a Person entity belong开发者_如何学Pythons to a person has a Country, I want to select all the distinct countries that have people in them. Easy in HQL

select distinct p.Country from Person p

How can I do this using a Criteria Query?


criteria.SetProjection(Projections.Distinct(Projections.Property("Country")));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜