コード例 #1
0
        public static List <pixProviders> providers()
        {
            List <pixProviders> providers;

            providers = MemoryCacheHelper.GetCachedData(Cache_Providers, everoneUseThisLockObject4Cache_Providers, 20, SomeHeavyAndExpensive_Providers_Calculation);

            return(providers);
        }
コード例 #2
0
        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());
        }