I have the next LINQ where o.Value and p.Value are decimal types
from o in dbContext.Ammounts
where o.Value > (from p in dbContext.Payments select p).Sum(p => p.Value))
The inner LINQ from p in dbContext.Payments select p).Sum(p => p.Value)
can be return a NULL value and I need to apply a ISNULL(linq_sentence, 0)
I try with this:
from o in dbContext.Ammounts
where o.Value > ((from p in dbContext.Payments select p).Sum(p => p.Value)) ?? 0m)
But I get this message error:
Operator '??' cannot be applied to operands of type 'decimal' and 'decimal'