public TValue Refresh() { _value = ValueSupplier.Invoke(); return(Peek()); }
/// <summary> /// Forces an invocation of <see cref="ValueSupplier"/> and stores the result in <see cref="_storedValue"/>, regardless of the current <see cref="Freshness"/>. /// </summary> /// <remarks> /// This method should rarely be called externally, as it bypasses the <see cref="StalenessPredicate"/> and <b>always</b> invokes the <see cref="ValueSupplier"/>. /// Most of the time, you should call <see cref="Value"/> instead. /// </remarks> /// <returns>the result of <see cref="ValueSupplier"/></returns> public TValue Refresh() { _storedValue = ValueSupplier.Invoke(); PreviousStalenessBasis = StalenessBasisSupplier.Invoke(); return(_storedValue); }