Beispiel #1
0
        public bool IsItFriday()
        {
            var val = _service.IsItFriday();

            Console.WriteLine("LoggingDecorator returning {0}", val);
            return(val);
        }
Beispiel #2
0
 public bool IsItFriday()
 {
     if (_lastRefresh + _cacheTimeout < DateTime.Now)
     {
         Console.WriteLine("Cache miss! Getting new value!");
         _cachedValue = _service.IsItFriday();
         _lastRefresh = DateTime.Now;
     }
     return(_cachedValue);
 }