title: How to avoid dependencies between Enum values in code and corresponding values in a database?
body: <p>I have a number of user permissions that are tested throughout my ASP.NET application. These permission values are referenced in an Enum so that I can conveniently test permissions like so:</p>
  
  <ul>
  <li>btnCreate.Enabled = PermissionManager.TestPermission(Permission.AllowCreate);</li>
  </ul>
  
  <p>However, I also have these permissions stored in the database because I need hold more info about them than just their Id. But this creates a horrible dependency between the enum values and those in the database, an ill considered change to either and I have problems throughout my application. Is there a better way around this issue? Has anyone dealt with this before?</p>