/// <summary> /// Create a Resilient Cache. /// </summary> /// <param name="cache"> /// A <see cref="IBrowsingCache" /> to proxy to. The resilient cache takes ownership of /// <paramref name="cache" /> and will dispose it when the resilient cache itself is disposed. If you /// reference or dispose <paramref name="cache" /> after you create the resilient cache, the behavior of /// the resilient cache and <paramref name="cache" /> is undefined. /// </param> /// <returns> /// A resilient cache. /// </returns> /// <exception cref="System.ArgumentNullException"> /// Thrown if <paramref name="cache" /> is a null reference. /// </exception> public static ResilientBrowsingCache Create(IBrowsingCache cache) => ResilientBrowsingCache.Create(cache, 5);
/// <summary> /// Create a Resilient Cache. /// </summary> /// <param name="cache"> /// A <see cref="IBrowsingCache" /> to proxy to. The resilient cache takes ownership of /// <paramref name="cache" /> and will dispose it when the resilient cache itself is disposed. If you /// reference or dispose <paramref name="cache" /> after you create the resilient cache, the behavior of /// the resilient cache and <paramref name="cache" /> is undefined. /// </param> /// <param name="retryAttempts"> /// The number of attempts a failed operation should be retried. /// </param> /// <returns> /// A resilient cache. /// </returns> /// <exception cref="System.ArgumentNullException"> /// Thrown if <paramref name="cache" /> is a null reference. /// </exception> /// <exception cref="System.ArgumentOutOfRangeException"> /// Thrown if <paramref name="retryAttempts" /> is less than or equal to <c>0</c>. /// </exception> public static ResilientBrowsingCache Create(IBrowsingCache cache, int retryAttempts) => ResilientBrowsingCache.Create(cache, retryAttempts, true);