Exemple #1
0
        /// <summary>
        /// Returns a caching strategy that cached individual items returned from the method by their specified key. The cache source type, method name, and item key will be used for the cache key and the method will be used as the retrieval mechanism for items not found in the cache
        /// </summary>
        public static BulkCacheStrategy <TKey, TResult> Method <T, TKey, TResult>(this Cache <T> cache, Expression <Func <T, ICollection <KeyValuePair <TKey, TResult> > > > method)
        {
            ExpressionAnalyzer analyzer = new ExpressionAnalyzer();

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