Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Application variables and Lock Action Controller

$
0
0

Hello, i want to lock my action in controller, because in this action i read and write a .json file saved in my website.

if action is "lock"  go in for loop with System.Threading.Thread.Sleep, there is a better solution ?

I think to use application variables but there is  HttpContext.Session not  HttpContext.Application ...

Better use other variable ? like cache ? private IMemoryCache _cache  _cache.TryGetValue  etc ?

thank's 


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>