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