I am currently implementing an associacion of strings and enums based on this suggestion. That being, I have a Description
attribute associated with every enum element. On that page there is also a function which returns the description's string based on the given enum. What I would like to implement now is the reverse function, that is, given an input string lookup the enum with the corresponding description if it exists, returning null otherwise.
I have tried (T) Enum.Parse(typeof(T), "teststring")
but it throws an exception.