public static List <pixProviders> providers() { List <pixProviders> providers; providers = MemoryCacheHelper.GetCachedData(Cache_Providers, everoneUseThisLockObject4Cache_Providers, 20, SomeHeavyAndExpensive_Providers_Calculation); return(providers); }
public ActionResult Index(string url) { var oldMediaUrlsDict = MemoryCacheHelper.GetCachedData(MemoryCacheHelper.CacheConsts.OldMediaUrls, () => _oldMediaService.GetAll().ToDictionary(x => x.OldPath)); if (oldMediaUrlsDict.ContainsKey(url)) { return(RedirectPermanent(oldMediaUrlsDict[url].NewPath)); } return(HttpNotFound()); }