I have the following code:
public enum RoleType
{
Default = 10,
Guest = 20,
User = 30,
Admin = 40,
Super = 50
}
Is there any way that I could get have some kind of toString method in the enum that would give me the strings “Default”, “Guest” .. etc I don’t mind to hard code these in one by one or even have a dictionary with the values hardcoded twice inside the enum. I would just like to keep everything self contained inside of my enum.
obj should be the value you want the name for