I\'m trying to build generic function that get from user string and try to parse it to Enum valuse like this:
private Enum getEnumStringEnumType(Type i_EnumT
Enum.TryParse is a generic method, which means that its generic type parameters have to be known at compile time. This in turn means that yes, you do have to declare resultInputType as a specific enum type for the code to compile.
If you think on it, the original code is a bit too optimistic: nowhere does it say which enum type should be checked for a member with name equal to userInputString. How could TryParse work without this information?