Register a DB Context with Simple Injector and .Net Core
You need to tell SimpleInjector how to instantiate the UsersDbContext
which seems to have a constructor with the parameter of type DbContextOptions
.
Change how you register your DbContext
by using an overload of Register
method that take a delegate (factory) parameter like below:
container.Register<DbContext>(() => {
var options = // Configure your DbContextOptions here
return new UsersDbContext(options);
});