How do you initialize application state at startup and access it from controllers in MVC 6?
Let's say I have a class called MySiteConfiguration in which I have a bunch of, you guessed it, configuration data. This data will not change over the course of the application's runtime after it has been loaded. My goal would be to construct an instance of this class at startup and access it from my controller actions. I do not want to construct the class more than once, as this should not be needed. To do this in WebApi 2 for instance, I would: Instantiate the class in my application start method. Store the instance on the HttpConfiguration.Properties Create a ControllerBase class which