I have an \'optional\' parameter on a method that is a KeyValuePair. I wanted an overload that passes null to the core method for this parameter, but in the core method, wh
KeyValuePair is a struct, not a class. It's like doing:
int i = 10;
if (i != null) ...
(Although that is actually legal, with a warning, due to odd nullable conversion rules. The important bit is that the if condition will never be true.)
To make it "optional", you can use the nullable form:
static void Foo(KeyValuePair
Note the ? in KeyValuePair