As I can see from the database interceptors I found for EF Core, they must be registered in Startup.cs using the AddInterceptors method. This method receives an instance, making the interceptor a singleton.
I need to inject a scoped service in the interceptor and this way it's not possible.
Is there any way to add scoped db interceptors to a DbContext?
services.AddDbContext<DatabaseContext>(options =>
options.UseSqlServer(
Configuration.GetConnectionString(...)
.AddInterceptors(new DatabaseLogIntgerceptor());