1

假设我有以下 hql:

select cast(coalesce(sum(c.Valoare), 0) as decimal)
      from Comision as c
      where c.User = :user

有没有办法在 Linq-To-Nhibernate 中写这个?

4

1 回答 1

0

您可以使用 C# 空合并运算符吗?

(from c in Comision
where c.User = user
select c.Valoare ?? 0).Sum()
于 2011-03-18T16:02:55.973 回答