I often come across a situation where I want to have a set of key / value pairs. Here's the idea of pseudocode:
DataSet MyRequestStatus
{
Accepted = "ACC",
Rejected = "REJ"
}
Using:
InsertIntoTable(MyRequestStatus.Accepted.ToString())
I want to use the friendly "MyRequestStatus.Accepted", but I want ToString () to return a critical "ACC" rather than "Accepted". Bonus points, implicit conversion, not a call to ToString ().
I did not find an obvious way to achieve this with Enums. What are you offering?
source
share