How to convert this method into a generic one?
I want to be able to do ManagerType.GetEnumNamesCorrected(), as well as with all my other enums. I've come up with this sudo code but it doesn't work
14 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
This works, thanks. Do you know if it's possible to turn it into an extension method so I can do ManagerType.GetValues(); instead of GetValues<ManagerType>()?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Then the extension method will be able to the values of the enum and not the enum itself
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Thats how it works rn
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
I want to be able to do ManagerType.GetValues();
Using your example
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Thats what Im thinking
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Its fine, just semantics. ExtensionMethods.GetValues<ManagerType>(); works just as good as ManagerType.GetValues();
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Thanks for the help any ways. Works perfect