假设我有以下hql:
select cast(coalesce(sum(c.Valoare), 0) as decimal)
from Comision as c
where c.User = :user
有没有办法在Linq-To-Nhibernate中写这个?
答案 0 :(得分:0)
您可以使用C#null合并运算符吗?
(from c in Comision
where c.User = user
select c.Valoare ?? 0).Sum()