コード例 #1
0
        private async Task <TechnicalResponse> GetNewResponseAndFallbackToCached(string requestText, TechnicalResponse cachedResponse, DateTime timeOfRequesting)
        {
            var latestResponse = await GetResponseRespectingLimits(requestText, timeOfRequesting);

            if (latestResponse != null && latestResponse.IsSuccess)
            {
                StoreResponse(latestResponse);
                return(latestResponse);
            }
            return(cachedResponse ?? latestResponse);
        }
コード例 #2
0
 private void StoreResponse(TechnicalResponse response)
 {
     _cachedResponses[response.RequestText] = response;
 }