title: Enum or actual table to store category with Entity Framework?
body: <p>I am using Entity Framework Code First to build my database. I have categories which do not change often, but could potentially change in the future. Would it be better practice to store the category data in enums or in an actual table? Below is an example of the ways I would implement the two approaches:</p>
  
  <p>With an enum:</p>
  
  <pre><code>public enum Role
  {
      Administrator, Employee, Developer
  }
  
  public class User
  {
      public int ID {get;set;}
      public string Name { get; set; }
      public Role Role { get; set; }
  }
  </code></pre>
  
  <p>With a separate table:</p>
  
  <pre><code>public class User
  {
      public int ID { get; set; }
      public string Name { get; set; }
      public int RoleID { get; set; } // Foreign key to Role table
      public virtual Role Role { get; set; } // Navigation property for Role
  }
  
  public class Role
  {
      public int ID { get; set; }
      public string RoleName { get; set; }
  }
  </code></pre>