Closed
Description
openedon Jun 28, 2021
Applications that need to inject the db context into background services (which are singletons) should be using the IDbContextFactory<TContext> instead of manually creating a scope and resolving the DbContext from it.
When I call services.AddDbContext<TContext> automagically add the supporting services to make injection of an IDbContextFactory work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment