title: Issues with extending Asp.Net Identity IdentityRole
body: <p>In my MVC5 project, I have exteneded the <code>IdentityUser</code> class in my <code>DbContext</code> with the following implementation:</p>
  
  <pre><code> public class ApplicationDbContext : IdentityDbContext&lt;ApplicationUser&gt;
      {
          public ApplicationDbContext()
              : base("DefaultConnection") { }
  
          protected override void OnModelCreating(DbModelBuilder modelBuilder)
          {
              base.OnModelCreating(modelBuilder);
              modelBuilder.Entity&lt;IdentityUser&gt;()
                 .ToTable("Users");
              modelBuilder.Entity&lt;ApplicationUser&gt;()
                  .ToTable("Users");
          }
  }
  </code></pre>
  
  <p>Using an <code>ApplicationUser</code> class:</p>
  
  <pre><code>public class ApplicationUser : IdentityUser
  {
      public string EmailAddress { get; set; }
      public string Name { get; set; }
      public DateTime JoinDate { get; set; }
      public string ConfirmationToken { get; set; }
      public bool EmailIsConfirmed { get; set; }
  }
  </code></pre>
  
  <p>However, whenever I try to do the same thing and extend the <code>IdentityRole</code> class it is not working. If I simply create an <code>ApplicationRole</code> class that inherits from <code>IdentityRole</code> (and change all instances of <code>IdentityRole</code> in my MVC project to <code>ApplicationRole</code>), then no roles are returned from the database. For example, using the following</p>
  
  <p><code>RoleManager&lt;ApplicationRole&gt; RoleManager = new RoleManager&lt;ApplicationRole&gt;(new RoleStore&lt;ApplicationRole&gt;(new ApplicationDbContext()));</code></p>
  
  <p>yields a result count of 0 when I call <code>RoleManager.Roles</code>.</p>
  
  <p>Has anyone done this yet and could provide some guidance?</p>
  
  <p><strong>UPDATE</strong>
  I had forgotten to change my DB Seed method to use my new <code>ApplicationRole</code> - it was still using <code>IdentityRole</code>. After doing so, I couldn't apply an update to my database because I kept getting a DBValidation error. After adapting some of the code from <a href="http://kazimanzurrashid.com/posts/implementing-user-confirmation-and-password-reset-with-one-asp-dot-net-identity-pain-or-pleasure" rel="nofollow">this post</a>, I was able to get everything working by overriding the <code>ValidateEntity</code> method of the DbContext</p>