private static void Main(string[] args) { Cache = new DictionaryCache(); Console.WriteLine("Begin calc 1..."); var v = Calc(5); // Will return the cached value Console.WriteLine("Begin calc 2..."); v = Calc(5); Console.WriteLine("end calc 2..."); }
private static void Main(string[] args) { Cache = new DictionaryCache(); Console.WriteLine("Begin calc 1..."); var v = Calc(5); // It last the same as the first function call Console.WriteLine("Begin calc 2..."); v = Calc(5); Console.WriteLine("end calc 2..."); }