I would say Enums. They provide you with a machine format in a readable format. Make sure you document it well.
///Summary /// About State Enum ///Summary enum State : int { ///Summary /// About Off Enum Value ///Summary Off = 0, ///Summary /// About On Enum Value ///Summary On, ///Summary /// About Ready Enum Value ///Summary Ready };
No need to assign a value to each member. Start at 0 and rest will automatically increase.
Since your listing is on / off, you can use it in a logical way. 0 means False or off and 1 means true or on.
You can also convert your enum to int as
int value = (int)State.On;
Save the value in the database as an int. and when extracting you can do it like this:
State st = (State)int.Parse(mydatabasevalue);
source share