title: How to access the database from AKKA.NET actors in .NET?
body: <p>I'm using AKKA.NET to build asynch processing logic in a .NET Core Console application (framework net46). </p>
  
  <p>Up to now I have used the built-in dependency injection to provide access to my IDbConnection object (or ApplicationDbContext for EF). This makes it easy to unittest. </p>
  
  <p>I'm very much in doubt what will be best practice when dealing with database access from within Actors. </p>
  
  <p>An easy approach is to write good old using-blocks like this: </p>
  
  <pre><code>using(var db = new ApplicationDbContext()) {
     ...query, modify and save objects using the db object
  }
  </code></pre>
  
  <p>and completely ignore the DI-container. </p>
  
  <p>I'm curious to find out, what experienced AKKA-developers consider best practice in this case?</p>