that question doesnt answer my question, as I need toString to be called, is there an extention method that can be added?
I have an Enum
public enum TimetableState
{
["Error Message"]
errormessage = 0,
Great = 1
}
I want to then call
TimetableState.errormessage.ToString();
and it display the string in the attribute 'Error Message', or if i call Great.ToString() the string 'Great' is returned.
the attribute can be anything, it does not have to be description.
I know it is possible to get this to work with ToString() directly, but how?
+++++++ This is not a duplicate, as I want to get the same as that but by calling ToString() on the enum, as I need a list sort and display to use it. is this possible? ++++++++