title: Is there any way to directly query the in memory database used by Entity Framework Core?
body: <p>I'm using the in-memory database provider to do some tests of a .Net Core 2.2 application. I need to make one of the tables in the application inaccessible - either by renaming it or dropping it. Is there any way to run that kind of query against the in memory DB directly? I've tried to get the connection using:</p>
  
  <pre><code>context.Database.GetDbConnection();
  </code></pre>
  
  <p>but that throws an error</p>
  
  <blockquote>
    <p>Relational-specific methods can only be used when the context is using a relational database provider.</p>
  </blockquote>
  
  <p>I am aware I can destroy the whole database with:</p>
  
  <pre><code>context.Database.EnsureDeleted();
  </code></pre>
  
  <p>but I need to retain it and only destroy or rename the one table.</p>