In ASP.NET Core / EntityFramework Core, the services.AddDbContext<> method will add the specified context as a scoped service. It\'s my understanding that that is the su
The lifetime is a parameter on AddDbContext<>(). See example:
AddDbContext<>()
services.AddDbContext(options => options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")), ServiceLifetime.Transient);
This will add it to the service collection with transient lifetime.