Does asp.net MVC have Application variables?

后端 未结 6 2211
感动是毒
感动是毒 2020-11-27 13:31

I am busy converting a web application to MVC and have some information saved to Application variables used across multiple tenants/accounts to make things a bit more effici

6条回答
  •  忘掉有多难
    2020-11-27 13:59

    Yes, you can access Application variables from .NET MVC. Here's how:

    System.Web.HttpContext.Current.Application.Lock();
    System.Web.HttpContext.Current.Application["Name"] = "Value";
    System.Web.HttpContext.Current.Application.UnLock();
    

提交回复
热议问题