IHttpContextAccessor outside of a controller or a service I am calling inside of a controller I do not have access. I would like to have a class where I can store some static properties that I use throughout the project. Currently I am trying to use the Session State but when using it outside of the request pipeline the HttpContext will be null. I have some classes that are not used inside of a controller that need access to the HttpContext Session State. I have created a scoped service that I can call inside of controllers or request pipeline and the functionality works but once I step outside of the pipeline I have no access. Any advice is welcome.Join the Discord to ask follow-up questions and connect with the community
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
62,470 Members
Join