title: Many to many relation between Identity and custom table. EF7 - Code first
body: <p>How can I make many to many relation between AspNetRoles from Identity 3.0 and my custom table? I want simple 3 table, with both PermissionId and RoleId, something like AspNetUsersRole. I have something like this:</p>
  
  <pre><code>public class Permission
  {
      public int PermissionId { get; set; }
      public string Name { get; set; }
      public virtual ICollection&lt;ApplicationRole&gt; Roles { get; set; }
  }
  
  public class ApplicationRole : IdentityRole
  {
      public virtual ICollection&lt;Permission&gt; Permissions { get; set; }
  }
  </code></pre>
  
  <p>But when I want to add migration, I got error:</p>
  
  <pre><code> Unable to determine the relationship represented by navigation property 'ApplicationRole.Permissions' of type 'ICollection&lt;Permission&gt;'. Either manually configure the relationship, or ignore this property from the model. 
  </code></pre>