title: How to get DbContext in ABP service?
body: <p>How to get <code>DbContext</code> instance in application layer?</p>
  
  <p>I tried:</p>
  
  <p>1.</p>
  
  <pre><code>public class SeedingTestDataAppService : MyAppServiceBase
  {
      private readonly MyDbContext _ctx;
  
      public SeedingTestDataAppService
      (
          MyDbContext context // Error
      )
      {
          _ctx = context;
      }
  }
  </code></pre>
  
  <p>2.</p>
  
  <pre><code>public class SeedingTestDataAppService : MyAppServiceBase
  {
      private readonly MyDbContext _ctx;
  
      public SeedingTestDataAppService
      (
          IDbContextProvider&lt;MyDbContext&gt; dbContextProvider
      )
      {
          _ctx = dbContextProvider.GetDbContext();
          // Error: unitOfWork is null
      }
  }
  </code></pre>
  
  <p>I am not good at ABP. Where and how can I take a <code>DbContext</code> instance and inject it?</p>