Okay, I have done some thinking and testing. This is what happens:
int value = nullableInt?.Value;
Gives this error message when compiling:
Type ‘int’ does not contain a definition for `Value’
That means that ? ‘converts’ the int? into the actual int value. This is effectively the same as:
int value = nullableInt ?? default(int);
The result is an integer, which doesn’t have a Value, obviously.
Okay, might this help?
int value = nullableInt?;
No, that syntax isn’t allowed.
So what then? Just keep using .GetValueOrDefault() for this case.
int value = nullableInt.GetValueOrDefault();