title: Creating an enum/class from a Database Table
body: <p>I have a database table that essentially contains different types of things.  I'll use animals as an example.  I have a table called AnimalTypes:</p>
  
  <pre><code>AnimalTypes
  {
       ID:int,
       Name:string
  }
  </code></pre>
  
  <p>I then populate it with:</p>
  
  <pre><code>1:Dog,
  2:Cat,
  3:Fish
  </code></pre>
  
  <p>I would like to then have some sort of C# object created that functions similar to this enum be entirely read from the database:</p>
  
  <pre><code>enum AnimalTypes
  {
       Dog = 1,
       Cat = 2,
       Fish = 3
  }
  </code></pre>
  
  <p>Is there a way to create an enum/class from a database table as described?  I basically want to be able to reference things in the AnimalTypes table using intellisense and AnimalTypes.Dog as an example; I don't actually need an enum, just something that kind of functions like one.  Is this possible?</p>
  
  <p>Edit: I'm not really that thrilled about generating a DLL as I've seen in other related problems.  I feel like this should be possible with reflection.</p>
  
  <p>Lets suppose I don't need intellisense.</p>