I ponder this question from time to time, so I thought I would ask you about it.
Let's say I have a database table that looks like this:
Table: Visibility
Id Value
-- -----
0 Visible
1 Invisible
2 Collapsed
This is just a table for referential integrity. This is basically an enumeration stored in a database, in order to ensure that any Visiblity values that appear in other tables are always valid.
In my front end, I have a choice.
- I could query this table and save it, for example,
Dictionary<string, int>or Dictionary<int, string>. I could write the enumeration manually and simply manually change the values in the rare case when there is a change in the table. For example.
public enum Visiblity
{
Visible,
Invisible,
Collapsed
}
- Something else????
What would you advise and why?
Thanks.