예제 #1
0
        public TOutput GetResults(TInput inputParameter)
        {
            var     cacheKey = GetCacheKey(inputParameter);
            TOutput itemFromCache;

            if (_cacheService.TryGetItemFromCache(cacheKey, out itemFromCache))
            {
                return(itemFromCache);
            }

            var itemFromSource = GetFromSource(inputParameter);

            _cacheService.AddItemToCache(cacheKey, itemFromSource, GetCacheExpirationInSeconds());
            return(itemFromSource);
        }