API.DataAccess.CacheManager.GetPlatformTagsAsync C# (CSharp) Метод

GetPlatformTagsAsync() публичный Метод

Gets the platform tag dictionary from the cache. May return an empty string if the cache expires.
public GetPlatformTagsAsync ( ) : Task
Результат Task
        public async Task<string> GetPlatformTagsAsync()
        {
            var cache = Connection.GetDatabase();
            var json = await cache.StringGetAsync(_platformTagsKey);
            return json;
        }

Usage Example

        public async Task <Dictionary <int, int> > GetPlatformTagsAsync()
        {
            var cacheJson = await _cacheManager.GetPlatformTagsAsync();

            if (string.IsNullOrWhiteSpace(cacheJson))
            {
                var storageJson = await _storageManager.GetPlatformTagsAsync();

                _cacheManager.SetPlatformTags(storageJson);
                return(JsonConvert.DeserializeObject <Dictionary <int, int> >(storageJson));
            }

            return(JsonConvert.DeserializeObject <Dictionary <int, int> >(cacheJson));
        }