【发布时间】:2020-11-12 18:00:47
【问题描述】:
所以我有一些 SQL 查询,我不确定如何转换为 NHibernate 语法
cast(case when count(distinct order) > 1 then count(distinct order) * -1 else max(order.orderId) end as int)
我目前有以下 NHibernate 代码:
projectionList.Add(
Projections.Conditional(
Restrictions.Gt(Projections.CountDistinct(() => orderDto), 1),
Projections.CountDistinct(() => orderDto), // TODO: * -1
Projections.Max(() => orderDto.orderId)
)
);
如您所见,我不确定* -1 部分该怎么做?有人知道怎么做吗?
【问题讨论】:
标签: c# sql nhibernate