private async Task <FbConnection> ProvideConnection(AsyncWrappingCommonArgs async) { if (_requiresNewConnection) { if (_sqlConnection != null && _sqlConnection.State != ConnectionState.Closed) { await CloseConnection(async).ConfigureAwait(false); } _sqlConnection = new FbConnection(_connectionString.ToString()); } if (_sqlConnection.State == ConnectionState.Closed) { await _sqlConnection.OpenImpl(async).ConfigureAwait(false); _shouldClose = true; } return(_sqlConnection); }