public async Task <APIResponse> GetServiceQuestionsById(ServiceQuestionServiceTypeParameters serviceQuestionServiceTypeParameters) { try { string serializedStories; // List<AssetResponse> stories; /* var encodedStories = await distributedCache.GetAsync(BlogServiceOperation.GetStoriesCacheName); * * if (encodedStories != null) * { * serializedStories = Encoding.UTF8.GetString(encodedStories); * stories = JsonConvert.DeserializeObject<List<StoryResponse>>(serializedStories); * } * else * {*/ var client = httpClientFactory.CreateClient(VendorServiceOperation.serviceName); UriBuilder url = new UriBuilder(servicesConfig.Vendor + VendorServiceOperation.GetServiceQuestionsById()); url.Query = QueryStringHelper.ConvertToQueryString(serviceQuestionServiceTypeParameters); var response = await client.GetAsync(url.ToString()); var assets = JsonConvert.DeserializeObject <ServiceQuestionResponse>(await response.Content.ReadAsStringAsync()); serializedStories = JsonConvert.SerializeObject(assets); /* encodedStories = Encoding.UTF8.GetBytes(serializedStories); * var options = new DistributedCacheEntryOptions() * .SetSlidingExpiration(TimeSpan.FromMinutes(1)) * .SetAbsoluteExpiration(DateTime.Now.AddHours(1)); * * await distributedCache.SetAsync(VendorServiceOperation.GetStoriesCacheName, encodedStories, options);*/ // } return(new APIResponse(assets, HttpStatusCode.OK)); } catch (Exception ex) { logger.Error(ex, "Exception in method 'GetAllBranches()'"); var exMessage = ex.InnerException != null ? ex.InnerException.Message : ex.Message; return(new APIResponse(exMessage, HttpStatusCode.InternalServerError)); } }