title: Getting DbContext from implementation of IDbCommandInterceptor
body: <p>I am using an <code>IDbCommandInterceptor</code> implementation:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class MyInterceptor : IDbCommandInterceptor
  {
      public void ReaderExecuting(DbCommand command, DbCommandInterceptionContext&lt;DbDataReader&gt; interceptionContext)
      {
          var context = interceptionContext.DbContexts.FirstOrDefault();
      }
  
      public void NonQueryExecuting(DbCommand command, DbCommandInterceptionContext&lt;int&gt; interceptionContext)
      {
      }
  
      public void ScalarExecuting(DbCommand command, DbCommandInterceptionContext&lt;object&gt; interceptionContext)
      {
      }
  
      public void NonQueryExecuted(DbCommand command, DbCommandInterceptionContext&lt;int&gt; interceptionContext)
      {
      }
  
      public void ReaderExecuted(DbCommand command, DbCommandInterceptionContext&lt;DbDataReader&gt; interceptionContext)
      {
      }
  
      public void ScalarExecuted(DbCommand command, DbCommandInterceptionContext&lt;object&gt; interceptionContext)
      {
      }
  }
  </code></pre>
  
  <p>Injected by this:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class TestContext : System.Data.Entity.DbContext
  {
      // …
  
      public TestContext()
          : base("TestConnectionString")
      {
          Database.SetInitializer&lt;TestContext&gt;(null);
          DbInterception.Add(new MyInterceptor());
      }
  }
  </code></pre>
  
  <p>(also tried in static constructor).</p>
  
  <p>But <code>interceptionContext.DbContexts</code> is always empty. How can I get an instance of executing context? Is it possible?</p>