I'm using AKKA.NET to build asynch processing logic in a .NET Core Console application (framework net46).
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.
I'm very much in doubt what will be best practice when dealing with database access from within Actors.
An easy approach is to write good old using-blocks like this:
using(var db = new ApplicationDbContext()) {
...query, modify and save objects using the db object
}
and completely ignore the DI-container.
I'm curious to find out, what experienced AKKA-developers consider best practice in this case?