title: OnConfiguring DbContextOptionsBuilder makes my database test fail
body: <p>I'm trying to test if my data is being saved in the database. When I create an ApplicationDbContext 
  object with the parameter set with an in-memory database SqliteConnection connection, my test fails. I get a NullReferenceException. When I remove the override OnConfiguring method in the ApplicationDbContext object to connect with secrets that are being set with my other constructor, I don't get the exception anymore and my test passes. </p>
  
  <p>What it's the simplest way to do this test while keeping my secrets setting for my connection?  </p>
  
  <p>These are some of my classes:</p>
  
  <pre><code>public class ApplicationDbContext : IdentityDbContext&lt;ApplicationUser&gt;
      {
          private readonly AppSecrets _DbInfo;
  
          public ApplicationDbContext(DbContextOptions&lt;ApplicationDbContext&gt; options, IOptions&lt;AppSecrets&gt; 
          DbInfo) : base(options)
          {
              _DbInfo = DbInfo.Value ?? throw new ArgumentException(nameof(DbInfo));
          }
  
          // Added for unit test
          public ApplicationDbContext(DbContextOptions&lt;ApplicationDbContext&gt; options): base(options){    }
  
          protected override void OnConfiguring(DbContextOptionsBuilder options) =&gt;
              options.UseSqlServer($"{_DbInfo.Database};User ID={_DbInfo.User};Password= {_DbInfo.Password};{_DbInfo.Options};");
  
          public DbSet&lt;UserBudget&gt; Budgets { get; set; }
      }
  </code></pre>
  
  <p>In StartUp.cs</p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
          {
              services.Configure&lt;AppSecrets&gt;(Configuration.GetSection("MyBudgetDB"));
  
              services.AddDbContext&lt;ApplicationDbContext&gt;(options =&gt;
                  options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
          }
  </code></pre>
  
  <p>Test</p>
  
  <pre><code>[Fact]
          public async Task CreateBudget_CreatesCorrectly()
          {
              const string budgetName = "General budget";
              double amount = 1000.0;
              var connection = new SqliteConnection("DataSource=:memory:");
              connection.Open();
              var options = new DbContextOptionsBuilder&lt;ApplicationDbContext&gt;()
                  .UseSqlite(connection)
                  .Options;
  
              // Run the test against one instance of the context
              using (var context = new ApplicationDbContext(options))
              {
                  context.Database.EnsureCreated();
                  var service = new BudgetService(context);
                  var cmd = new CreateBudgetCommand
                  {
                      InitAmount = amount,
                  };
                  var user = new ApplicationUser
                  {
                      Id = 123.ToString()
                  };
                  var recipeId = service.CreateBudget(cmd, user);
              }
  
              // Use a separate instance of the context to verify correct data was saved to database
              using (var context = new ApplicationDbContext(options))
              {
                  Assert.Equal(1000.0, await context.Budgets.CountAsync());
                  var budget = await context.Budgets.SingleAsync();
                  Assert.Equal(amount, budget.InitAmount);
              }
          }
  </code></pre>
  
  <p>Thanks,
  Leidy</p>