I have an object with the property Value. Value is a nullable number. I have some scenarios for the value of value. Usually, for null cases, I use the default case but this time, it is not correct logically. I want to do "X" in case of 100, "Y" in case of no value (the value is null), otherwise, I want to do "Z".
switch (p.Value)
{
case 100:
// DO X
break;
default:
// Do Z
break;
} …Run Code Online (Sandbox Code Playgroud)