Why does Linq SUM of nullables return nullable #113436
Unanswered
matthiaslischka
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The return type of the Linq
Sum()
method on a list of nullables is nullable, even though the sum will never benull
:So why even have the return type nullable then? I find that confusing as I would have expected the sum to be null if any element is null, just like with regular addition:
Beta Was this translation helpful? Give feedback.
All reactions