嘿 - 我正在努力弄清楚如何使用 NHibernate ICriteria(多标准?)为以下内容编写以下内容:
(这是一个查询,以获取最后一天在表格中按受欢迎程度排序的名字列表)
select firstname,count(firstname) as occurances from registrants
where timestamp between DateAdd(day,-1, GetDate()) and getdate()
group by firstname
order by count(firstname) desc
此外,鉴于这只是表中的几列,不包括 ID,并且 NHibernate 需要 ID 来作为它的对象,那么“伪造”ID 的最简单方法是什么,以便我可以得到结果?