title: using IdentityServer4 with custom Configration DBContext
body: <p>I created a customized <code>IConfigurationDbContext</code> in order to using IDS4 with Oracle. </p>
  
  <pre><code>  public class IdentityConfigurationDbContext :  DbContext, IConfigurationDbContext {
          private readonly ConfigurationStoreOptions storeOptions;
  
          public IdentityConfigurationDbContext(DbContextOptions&lt;IdentityServerDbContext&gt; options)
           : base(options) {
      }
  
      public IdentityConfigurationDbContext(DbContextOptions&lt;ConfigurationDbContext&gt; options, ConfigurationStoreOptions storeOptions)
          : base(options) {
          this.storeOptions = storeOptions ?? throw new ArgumentNullException(nameof(storeOptions));
      }
  
      public DbSet&lt;Client&gt; Clients { get; set; }
      public DbSet&lt;IdentityResource&gt; IdentityResources { get; set; }
      public DbSet&lt;ApiResource&gt; ApiResources { get; set; }
  
      protected override void OnModelCreating(ModelBuilder modelBuilder) {
          modelBuilder.ConfigureClientContext(storeOptions);
          modelBuilder.ConfigureResourcesContext(storeOptions);
  
          base.OnModelCreating(modelBuilder);
      }
    }
  </code></pre>
  
  <p>in ConfigureService:</p>
  
  <pre><code> services.AddIdentityServer()
                  .AddTemporarySigningCredential()
                  .AddAspNetIdentity&lt;ApplicationUser&gt;();
  </code></pre>
  
  <p>I also have my custom <code>IClientStore</code> which is added to the container like this:</p>
  
  <pre><code>services.AddScoped&lt;IClientStore, ClientStore&gt;();
  </code></pre>
  
  <p>when I run <code>IdentityConfigurationDbContext</code> migration, I get this error:</p>
  
  <pre><code>System.InvalidOperationException: No database provider has been configured for this DbContext.
  </code></pre>
  
  <p>I tried doing this: </p>
  
  <pre><code>services.AddDbContext&lt;IdentityConfigurationDbContext&gt;(builder =&gt; builder.UseOracle(connectionString, options =&gt; {
                  options.MigrationsAssembly(migrationsAssembly);
                  options.MigrationsHistoryTable("EF_MIGRATION_HISTORY");
              }));
  </code></pre>
  
  <p>Is this the right way to use a custom dbcontext with IDS4? and How do I fix this issue, and complete my migration work?</p>