Last active
June 16, 2016 12:38
-
-
Save Muscipular/caa1c5a6d4da738b2816b38b058567cb to your computer and use it in GitHub Desktop.
EnumUtils
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class EnumClassUtils<TClass> | |
where TClass : class | |
{ | |
public static TEnum Parse<TEnum>(string value) | |
where TEnum : struct, TClass | |
{ | |
return (TEnum) Enum.Parse(typeof(TEnum), value); | |
} | |
} | |
public class EnumUtils : EnumClassUtils<Enum> | |
{ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment