I have a standard C# enum representing bank accounts:
public enum Accounts
{
BankOfAmerica = 123654,
BankOfIndia = 765091
}
This enum is used in many places in my code. Some objects use it for using the account number as a string ("123654"), as an integer (123654) or the name of the account as a string ("BankOfAmerica").
The accounts number change and they contain also digits, therefore I can't simply change the enum...
Can someone point a way to make this change as painless as possible, with the minimum number of changes in the code?
I thought of replacing the enum with a singleton class containing the account names and values, but then many code changes were necessary to replace the usage of the old enum with the new class.
enumto hold magic-number constants like this in C#.