readonly AsyncRetryPolicy _retryPolicy;
_retryPolicy = Policy .Handle<MongoDB.Driver.MongoInternalException>() .WaitAndRetryAsync(3, attempt => TimeSpan.FromSeconds(_retryInterval[attempt - 1]));
`await _retryPolicy.ExecuteAsync(async () => { var updateResult = await repository.UpdateAsync(param1, param2, cancellationToken); totalUpdatedRows += updateResult?.ModifiedCount ?? 0;
if (updateResult == null || updateResult.MatchedCount == 0 || totalUpdatedRows != alertIntegrationsCount)
{
throw new MongoDB.Driver.MongoInternalException("No Record Found");
}
}); `