Development – Leet 4 Life

Software Development Code Samples and More

Skip to: Content | Sidebar | Footer

Tag: Data Source

Using an Enumeration as a Data Source

12 March, 2012 | C#. NET | By: Michael Merrell

Enumerations have many uses but one use that doesn’t get much attention is using an enumeration as a data source.   I have written two methods that will take in an enumeration (Either Type name as string or the actual Type) and then return a dictionary of all the name/value pairs.  All enumerations have a numerical value, whether the actual values are defined specifically or automatically populated is up to the developer.  A long is used here as all values that can be defined for an enumeration will convert to a long value.  However, you can also assign an integer or byte value [Read More…]