Why is this not returning the proper string even though the dictionary is showing the correct key/value pairs while debugging?
IDictionary<string, string> states =
AFS.MvcApplication.UnitedStates.StateDictionary;
string stateAbbrev =
states.Where(x => x.Key == State).Select(x => x.Value).ToString();
You want to use
FirstOrDefaultinstead ofToString, since the result ofSelectis anIEnumerable<string>. This should work: