예제 #1
0
        /// <summary>
        /// Returns a 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
        /// </summary>
        public static CacheStrategy <TResult> Method <T, TResult>(this Cache <T> cache, Expression <Func <T, TResult> > method)
        {
            ExpressionAnalyzer analyzer = new ExpressionAnalyzer();

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