15 lines
332 B
C#
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);
|
||
|
}
|
||
|
}
|