Philip Hendry's Blog

Strongly Typing Enumeration Parsing

Aug 25, 2009 • Code • Less than a minute read

Given this enum :

image

Instead of this code :image

I would rather see this :

image

I can’t add an extension to the Enum system class but I can create a new generic Enum class which strongly types the results :

image

Post by: Philip Hendry