✅ Proper way of using EF DbContext in a BackgroundService
Hello,
The dbContext and the
The possible options are: injecting the
Which one of the interfaces is better to use? There surely must be some difference...
The dbContext and the
BackgroundService have different scopes. I've seen there are 2 solutions.The possible options are: injecting the
IServiceProvider, or the IServiceScopeFactory, then manually creating a context.Which one of the interfaces is better to use? There surely must be some difference...