.Net Core Dependency Injection without passing Dependency in Constructor

I am implementing custom [Authorize] attribute. Inside the OnAuthorization method in IdentityAuthorizeFilter Class, I need to have access to DBContext to perform Database checks. I can not pass the context in the constructor of the Class. How can I access DBContext inside this class ? Startup.cs public void ConfigureServices(IServiceCollection services) { services.AddDbContext<SecureContext>(options => options.UseSqlServer(Configuration.GetConnectionString("SecureContext"))); }… Read More .Net Core Dependency Injection without passing Dependency in Constructor