I’ve got an object, specifically the following:
table.ExtendedProperties["MS_Description"].Value
If there is not property, the Value is null. If there is a property, but it is empty, the Value.toString() is "".
I would thus like to create an if-statement which caters for both eventualities. This is what I’ve done so far:
if (table.ExtendedProperties["MS_Description"] == null ||
table.ExtendedProperties["MS_Description"].Value.ToString().Equals(""))
The problem is that if it is null, it is still checking the condition on the right-hand-side.
Any ideas?
Thus
Valueis not a string, then you have to deal with all conditions:BTW your code is not quite correct
Instead of checking Value for null, you are checking if
table.ExtendedProperties["MS_Description"]is not null. Thats true. You go further, but iftable.ExtendedProperties["MS_Description"].Valueis null (you didn’t check that, remember?), you will get NullReferenceException on applyingToString().