Esempio n. 1
0
        /// <summary>
        /// Returns an async caching strategy for the specified method. The cache source type and method name will be used for the cache key and the method will be used as the retrieval mechanism if the item is not found in the cache
        /// </summary>
        public static CacheStrategyAsync <TResult> Method <T, TResult>(this Cache <T> cache, Expression <Func <T, Task <TResult> > > method)
        {
            ExpressionAnalyzer analyzer = new ExpressionAnalyzer();

            return(analyzer.CreateAsyncCacheStrategy(cache, method)
                   .RetrieveUsingMethod());
        }