开发者

equivalent of hql coalesce in linq-to-nhibernate

Supposing I have the following hql:

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

Is there any way of writing this in Linq-T开发者_如何学Co-Nhibernate?


Can you use the C# null coalescing operator?

(from c in Comision
where c.User = user
select c.Valoare ?? 0).Sum()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜