Exemple #1
0
 /// <summary>
 /// Use the previous cached value (or a default value if there is no previous value) if the retrieval mechanism failed
 /// </summary>
 public static CacheStrategyAsync <T> IfRetrievalFailsUsePreviousValueOrDefault <T>(this CacheStrategyAsync <T> source, T defaultValue)
 {
     return(source.IfRetrievalFails((ex, cachedValue) => RetrievalErrorHandlerResult <T> .UsePreviousCachedValueOrDefault(ex, cachedValue, defaultValue)));
 }
Exemple #2
0
 /// <summary>
 /// Use the previous cached value if the retrieval mechanism failed
 /// </summary>
 public static CacheStrategyAsync <T> IfRetrievalFailsUsePreviousValue <T>(this CacheStrategyAsync <T> source)
 {
     return(source.IfRetrievalFails(RetrievalErrorHandlerResult <T> .UsePreviousCachedValue));
 }