Skip to content

Instantly share code, notes, and snippets.

@rymoore99
Last active September 6, 2016 18:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rymoore99/9127904 to your computer and use it in GitHub Desktop.
Save rymoore99/9127904 to your computer and use it in GitHub Desktop.
public static class EnumUtil {
public static IEnumerable<T> GetValues<T>() {
return Enum.GetValues(typeof(T)).Cast<T>();
}
public static T ParseEnum<T>( string value )
{
return (T) Enum.Parse( typeof( T ), value, true );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment