I have a dictionary that is like this:
Dictionary<string, object> myDictionary = new Dictionary<string, object>();
When I get data out of it, I am doing it like this:
myDictionary["IndexingValue"]
Most of the time that is working. But I just changed one of the values that it stores to be null. Now when I do that same call (expecting null) I get and exception. When I put it in the debugger it says "Could Not Evaluate Expression".
So I said to my self, "OK, somehow my IndexingValue
is not in the dictionary. But I went and looked at myDictionary.entries and sure enough it is there.
What I want to do is something like this:
if (myDictionary["IndexingValue"] != <Could not evaluate expression>)
{
//do some logic.
}
(IE find some way to know when the expression can not be evaluated with out having to throw an exception.)
Can this be done?