I am populating a "Dictionary" with the results of an sp call. The key is the field name and the value is whatever value the sp returns for the field. This is all well and good but I'd like developers to have a predefined list of keys to access this list, for safety and documentation reasons. What I'd like to do is have something like an enum as a key for the dictionary so developers can safely access the list, but still have the ability to access the dictionary with a string key value.
I am hoping to have a list of string values that I can access with an enum key AND a string key. Please make sure any suggestions are simple to implement, this is not the kind of thing I'm willing to build a lot of overhead to implement.
NOTE: I'd like there to be one key that drives this not one enum declaration and one List declaration in that I'd be maintaining two lists of keys, just in slightly different formats.
UPDATE: Let me clarify the reason I'd like a string key, I am using this list of stuff in once case to do replacements in a larger string that has something like ##keyName##. So i need to be able get values out of my dictionary based on what's in the ####. I don't know how to do that if I'm using an enum as my key. if I could map the string "keyName" to enum.keyName then my problems are solved.