So I have a bit of a SQL query which I am not sure how to convert to NHibernate syntax
cast(case when count(distinct order) > 1 then count(distinct order) * -1 else max(order.orderId) end as int)
I currently have the following NHibernate code:
projectionList.Add(
Projections.Conditional(
Restrictions.Gt(Projections.CountDistinct(() => orderDto), 1),
Projections.CountDistinct(() => orderDto), // TODO: * -1
Projections.Max(() => orderDto.orderId)
)
);
As you can see, I am not sure how to do the * -1 part? Has somebody any idea how to do it?