Skip to content

Commit b954f77

Browse files
committed
Remove connection state check
1 parent 74433f8 commit b954f77

File tree

4 files changed

+0
-8
lines changed

4 files changed

+0
-8
lines changed

QueryDB/MSSQL/Adapter.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ internal SqlCommand GetSqlCommand(string cmdText, SqlConnection connection, Comm
5151
/// <returns>A new <see cref="SqlCommand"/> instance configured with the provided connection and transaction.</returns>
5252
internal SqlCommand GetSqlCommand(string cmdText, SqlConnection connection, SqlTransaction transaction)
5353
{
54-
if (connection.State != ConnectionState.Open)
55-
connection.Open();
5654
var sqlCommand = new SqlCommand(cmdText, connection, transaction);
5755
return sqlCommand;
5856
}

QueryDB/MySQL/Adapter.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ internal MySqlCommand GetMySqlCommand(string cmdText, MySqlConnection connection
5151
/// <returns>A new <see cref="MySqlCommand"/> instance configured with the provided connection and transaction.</returns>
5252
internal MySqlCommand GetMySqlCommand(string cmdText, MySqlConnection connection, MySqlTransaction transaction)
5353
{
54-
if (connection.State != ConnectionState.Open)
55-
connection.Open();
5654
var sqlCommand = new MySqlCommand(cmdText, connection, transaction);
5755
return sqlCommand;
5856
}

QueryDB/Oracle/Adapter.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ internal OracleCommand GetOracleCommand(string cmdText, OracleConnection connect
5050
/// <returns>A new <see cref="OracleCommand"/> instance configured with the provided connection.</returns>
5151
internal OracleCommand GetOracleCommand(string cmdText, OracleConnection connection)
5252
{
53-
if (connection.State != ConnectionState.Open)
54-
connection.Open();
5553
var sqlCommand = new OracleCommand(cmdText, connection);
5654
return sqlCommand;
5755
}

QueryDB/PostgreSQL/Adapter.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ internal NpgsqlCommand GetPostgreSqlCommand(string cmdText, NpgsqlConnection con
5151
/// <returns>A new <see cref="NpgsqlCommand"/> instance configured with the provided connection and transaction.</returns>
5252
internal NpgsqlCommand GetPostgreSqlCommand(string cmdText, NpgsqlConnection connection, NpgsqlTransaction transaction)
5353
{
54-
if (connection.State != ConnectionState.Open)
55-
connection.Open();
5654
var sqlCommand = new NpgsqlCommand(cmdText, connection, transaction);
5755
return sqlCommand;
5856
}

0 commit comments

Comments
 (0)