public async Task <PlatoFacebookSettings> GetAsync() { var token = _cacheManager.GetOrCreateToken(this.GetType()); return(await _cacheManager.GetOrCreateAsync(token, async (cacheEntry) => await _dictionaryStore.GetAsync <PlatoFacebookSettings>(SettingsKey))); }
public async Task <IShellDescriptor> GetAsync() { var token = _cacheManager.GetOrCreateToken(this.GetType(), Key); return(await _cacheManager.GetOrCreateAsync(token, async (cacheEntry) => await _dictionaryStore.GetAsync <ShellDescriptor>(Key))); }
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); }
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(); })); }