-
|
Can anyone tell me what I'm doing wrong here? I would expect that the missing values would be replaced with 0 and the decimal type conversion would succeed. Instead I get Am I not doing this in the right way? |
Beta Was this translation helpful? Give feedback.
Answered by
JoshClose
Mar 22, 2024
Replies: 1 comment 1 reply
-
|
Your properties in You can set a default of public record Data([Default(0)]decimal First, [Default(0)]decimal Second, [Default(0)]decimal Third); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
sgrassie
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NullValuesare data that is converted tonull. What you're doing would setnullif the field was0.Your properties in
Recordaren'tNullable, so you don't wantnullanyway.You can set a default of
0.