Resolving scoped services during application startup can be difficult, because there is no request and hence no scoped service.
Resolving a scoped service during application startup via app.ApplicationServices.GetService<AppDbContext>() can cause issues, because it will be created in the sc...