Innovenergy_trunk/csharp/Lib/Utils/Try/Operators.sync.cs

15 lines
332 B
C#

namespace InnovEnergy.Lib.Utils.Try;
public partial class TrySync<R>
{
public TrySync<R> Retry(Int32 nTimes)
{
return Retry<Exception>(nTimes);
}
public TrySync<R> Retry<E>(Int32 nTimes) where E:Exception
{
Boolean ShouldRetry(E _) => nTimes-- > 0;
return Retry<E>(ShouldRetry);
}
}