title: How to remove some default identity tables in ASP.NET Core 2.2
body: <p>I am trying to remove some of default identity tables by ignoring them in <code>OnModelCreating</code> as follows:</p>
  
  <pre><code>public class ApplicationDbContext : IdentityDbContext
  {
      public ApplicationDbContext(DbContextOptions&lt;ApplicationDbContext&gt; options)
          : base(options)
      {
      }
  
      protected override void OnModelCreating(ModelBuilder modelBuilder)
      {
          base.OnModelCreating(modelBuilder);
  
          modelBuilder.Entity&lt;ApplicationUser&gt;(p =&gt; p.HasOne(e=&gt;e.Department).WithOne().IsRequired());
          modelBuilder.Ignore&lt;IdentityUserToken&lt;string&gt;&gt;();
          modelBuilder.Ignore&lt;IdentityUserClaim&lt;string&gt;&gt;();
          modelBuilder.Ignore&lt;IdentityUserLogin&lt;string&gt;&gt;();
          modelBuilder.Ignore&lt;IdentityRoleClaim&lt;string&gt;&gt;();
          modelBuilder.Ignore&lt;IdentityUser&lt;string&gt;&gt;();
      }
  }
  </code></pre>
  
  <p>and in startup.cs I configured the identity like:</p>
  
  <pre><code>services.AddIdentity&lt;ApplicationUser, IdentityRole&gt;()
              .AddDefaultUI(UIFramework.Bootstrap4)
              .AddEntityFrameworkStores&lt;ApplicationDbContext&gt;();
  </code></pre>
  
  <p>When I register a user everything work fine, but when a user tries to login it throws this error:</p>
  
  <blockquote>
    <p>Cannot create a DbSet for 'IdentityUserClaim' because this
    type is not included in the model for the context</p>
  </blockquote>
  
  <p>what did I miss in my configurations?</p>
  
  <p>please don't mark it as duplicate because I searched a lot and yet couldn't fine an appropriate solution</p>