title: Mapping a list of Enums
body: <p>I have a table called UserPermissions with a FK to the users table by userId and then a string column for the string value of an enum.</p>
  
  <p>The error I am seeing is NHibernate.MappingException: An association from the table UserPermissions refers to an unmapped class: GotRoleplay.Core.Domain.Model.Permission</p>
  
  <p>My Permission Enum:</p>
  
  <pre><code>    public enum Permission
  {
      [StringValue("Add User")]
      AddUser,
  
      [StringValue("Edit User")]
      EditUser,
  
      [StringValue("Delete User")]
      DeleteUser,
  
      [StringValue("Add Content")]
      AddContent,
  
      [StringValue("Edit Content")]
      EditContent,
  
      [StringValue("Delete Content")]
      DeleteContent,
  }
  </code></pre>
  
  <p>The property in my User class:</p>
  
  <pre><code>public virtual IList&lt;Permission&gt; Permissions { get; set; }
  </code></pre>
  
  <p>My database table:</p>
  
  <pre><code>CREATE TABLE dbo.UserPermissions
  (
  UserPermissionId            int                 IDENTITY(1,1) NOT NULL,
  UserId                      int                 NOT NULL,
  PermissionName              varchar (50)        NOT NULL,
  
  CONSTRAINT PK_UserPermissions PRIMARY KEY CLUSTERED (UserPermissionId),
  CONSTRAINT FK_UserPermissions_Users FOREIGN KEY (UserId) REFERENCES Users(UserId),
  CONSTRAINT U_User_Permission UNIQUE(UserId, PermissionName)
  )
  </code></pre>
  
  <p>My attempt at mapping the permissions property of my user object:</p>
  
  <pre><code>HasManyToMany(x =&gt; x.Permissions)
               .WithParentKeyColumn("UserId")
               .WithChildKeyColumn("PermissionName")
               .WithTableName("UserPermissions")
               .LazyLoad();
  </code></pre>
  
  <p>What am I doing wrong that it can't map the permission to a list of enum values?</p>