title: Entity Framework Core - Use In Memory Database and fill with fake data
body: <p>I'm stuck on how to add the DBContext in the <code>Startup.cs</code>. I have the following which doesn't work (but I was finally able to get it to compile). How can I reduce this to using the <code>options</code> I define and using that in my <code>using</code> statement. Obviously I don't want to define two different databases, but this was the only way I could get it to compile. If I'm approaching this the wrong way, please let me know. Here is a sample from <code>ConfigureServices()</code> in <code>Startup.cs</code></p>
  <pre><code>var options = new DbContextOptionsBuilder&lt;ApiContext&gt;().UseInMemoryDatabase(databaseName: &quot;Appointments&quot;);
  services.AddDbContext&lt;ApiContext&gt;(options =&gt; options.UseInMemoryDatabase(databaseName: &quot;Test&quot;));
  using (var context = new ApiContext(options.Options))
  {
       //Create Fake Data
       DataGenerator.GenerateData(context);
  }
  </code></pre>