Created
April 12, 2014 07:21
-
-
Save dchw/10522849 to your computer and use it in GitHub Desktop.
Enum extension method example
This file contains hidden or 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 static class SuperheroEx | |
{ | |
public static string Name(this Superhero superhero) | |
{ | |
return Enum.GetName(typeof(Superhero), superhero); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment