Esempio n. 1
0
        public async Task <PlatoFacebookSettings> GetAsync()
        {
            var token = _cacheManager.GetOrCreateToken(this.GetType());

            return(await _cacheManager.GetOrCreateAsync(token,
                                                        async (cacheEntry) => await _dictionaryStore.GetAsync <PlatoFacebookSettings>(SettingsKey)));
        }
Esempio n. 2
0
        public async Task <IShellDescriptor> GetAsync()
        {
            var token = _cacheManager.GetOrCreateToken(this.GetType(), Key);

            return(await _cacheManager.GetOrCreateAsync(token,
                                                        async (cacheEntry) => await _dictionaryStore.GetAsync <ShellDescriptor>(Key)));
        }
Esempio n. 3
0
        public async Task <HttpsSettings> GetAsync()
        {
            if (!_memoryCache.TryGetValue(SettingsKey, out HttpsSettings settings))
            {
                settings = await _dictionaryStore.GetAsync <HttpsSettings>(SettingsKey);

                if (settings != null)
                {
                    _memoryCache.Set(SettingsKey, settings);
                }
            }
            return(settings);
        }
Esempio n. 4
0
        public async Task <TourDescriptor> GetAsync()
        {
            var token = _cacheManager.GetOrCreateToken(this.GetType(), Key);

            return(await _cacheManager.GetOrCreateAsync(token, async (cacheEntry) =>
            {
                var descriptor = await _dictionaryStore.GetAsync <TourDescriptor>(Key);
                if (descriptor != null)
                {
                    return descriptor;
                }
                return new DefaultTourDescriptor();
            }));
        }