title: Using enumeration classes in EF
body: <p>I'm using enumeration classes based on <a href="https://lostechies.com/jimmybogard/2008/08/12/enumeration-classes/" rel="nofollow">this</a> article from Jimmy Bogard in my domain model. However, EF treats the classes as entities and wants a key to be defined.</p>
  
  <p>Is there a way to make EF store the values from the enumeration classes like it does it with standard C# enums? </p>
  
  <p>This is how I currently implemented the enumeration class:</p>
  
  <pre><code>public class ReservationStatus : Enumeration
  {
      public static readonly ReservationStatus Outstanding = new ReservationStatus(0, "Oustanding");
      public static readonly ReservationStatus Paid = new ReservationStatus(1, "Paid");
      public static readonly ReservationStatus Canceled = new ReservationStatus(2, "Canceled");
      public static readonly ReservationStatus Rejected = new ReservationStatus(3, "Rejected");
  
      private ReservationStatus() { }
      private ReservationStatus(int value, string displayName) : base(value, displayName) { }
  }
  
  public class Reservation : Entity&lt;int&gt;
  {
      public ReservationStatus Status { get; set; }
  }
  </code></pre>
  
  <p>I'm using EF 7 RC1.</p>