public override async Task <bool> ExistsAsync(CancellationToken cancellationToken = default(CancellationToken)) { var retryCount = 0; while (true) { try { await _connection.OpenAsync(cancellationToken); _connection.Close(); return(true); } catch (SqlException e) { if (IsDoesNotExist(e)) { return(false); } if (!RetryOnNoProcessOnEndOfPipe(e, ref retryCount)) { throw; } } } }
private async Task <bool> ExistsAsync(bool retryOnNotExists, CancellationToken cancellationToken) { var retryCount = 0; while (true) { try { await _connection.OpenAsync(cancellationToken).WithCurrentCulture(); _connection.Close(); return(true); } catch (SqlException e) { if (!retryOnNotExists && IsDoesNotExist(e)) { return(false); } if (!RetryOnExistsFailure(e, ref retryCount)) { throw; } } } }