示例#1
0
        public async Task <List <Country> > GetAllCountriesAsync()
        {
            var cachedList = _cacheManagement.GetValue <List <Country> >(AppConst.Cache.CountryList);

            if (cachedList != null && cachedList.Any())
            {
                return(cachedList);
            }
            return(_cacheManagement.CacheCall(
                       AppConst.Cache.CountryList,
                       AppConst.Cache.DefaultTimeoutInSeconds,
                       await GetAllCountriesFromApi()));
        }