I would like to have a simple helper method for converting a string to Enum. Something like the following, but T doesn't like it as the first argument in Enum.Parse. Error T is a type parameter, but is used as a variable.
public static T StringToEnum<T>(String value) { return (T) Enum.Parse(T,value,true) ; }
source share