Skip to content

Instantly share code, notes, and snippets.

int retryAttempts = 1;
do
{                   
   try
   {
       // do something
    }
    catch (DivideByZeroException dbze)
    {
        if (retryAttempts > 0)
Policy
.Handle<DivideByZeroException>()
.Retry(3, (exception, retryCount, context) =>
{
// do something
});