title: Store does not implement IUserRoleStore<TUser> ASP.NET Core Identity
body: <p>I'm using ASP.NET Core 2.1 Identity.  I've overridden IdentityUser because I need to add some additional properties on the user.  </p>
  
  <p>In Startup.cs</p>
  
  <pre><code>services.AddDefaultIdentity&lt;PortalUser&gt;().AddEntityFrameworkStores&lt;ApplicationDbContext&gt;();
  </code></pre>
  
  <p>ApplicationDbContext.cs</p>
  
  <pre><code>public partial class ApplicationDbContext : IdentityDbContext&lt;PortalUser&gt;
  {
      public ApplicationDbContext(DbContextOptions&lt;ApplicationDbContext&gt; options) : base(options)
      {
  
      }
  }
  </code></pre>
  
  <p>PortalUser class</p>
  
  <pre><code>public class PortalUser : IdentityUser
  {
      [PersonalData]
      public DateTime? LastLoginDateUtc { get; set; }
  
      [PersonalData]
      public DateTime? RegistrationDateUtc { get; set; }
  }
  </code></pre>
  
  <p>That's all working fine.  I can add a user via.</p>
  
  <pre><code>_userManager.CreateAsync(user)
  </code></pre>
  
  <p>However, when I call AddToRolesAsync to add a role to a user, I'm getting an exception.  Any ideas why?</p>
  
  <pre><code>_userManager.AddToRolesAsync(user, new List&lt;string&gt; { roleName });
  
  {System.NotSupportedException: Store does not implement IUserRoleStore&lt;TUser&gt;.
     at Microsoft.AspNetCore.Identity.UserManager`1.GetUserRoleStore()
     at Microsoft.AspNetCore.Identity.UserManager`1.AddToRolesAsync(TUser user, IEnumerable`1 roles)}
  </code></pre>