I have a problem with my linq query. I get a null reference exception. What's wrong with my code? I do null checks but still get an exception.
What am I doing wrong?
Math.Round(invoiceData?.Lines?.Sum(x => x.Amount) ?? 0, 2);
Thanks in advance.