コード例 #1
0
        public async Task <BaseResult> ReloadCache()
        {
            BaseResult response = new BaseResult();

            try
            {
                _objectCache.DeleteItem(_productCacheKey);

                GetProductsResult output = await _eatClient.GetProductsAsync();

                if (output == null)
                {
                    throw new Exception("Service did not return the products and returned an error: " + output.Error);
                }
                _objectCache.SetItem(_productCacheKey, output);
            }
            catch (Exception ex)
            {
                SetException(response, ex);
            }
            return(response);
        }