Using HttpContext.Current.Application to store simple data

后端 未结 5 1045
旧时难觅i
旧时难觅i 2020-12-09 19:02

I want to store a small list of a simple object (containing three strings) in my ASP.NET MVC application. The list is loaded from the database and it is updated rarely by ed

5条回答
  •  有刺的猬
    2020-12-09 19:28

    Application_Start really only gets fired on App Pool Recylce's, IIS Resets or reboots. If your updating these values that infrequently, why not store them in your web.config and access them that way?

    That being said, I don't think there is anything wrong with your approach. Though more typically I've seen people using config files for rarely changed values.

提交回复
热议问题