I have this Code:
OracleConnection myOracleConnection = new OracleConnection(connectionString);
myOracleConnection.Open();
OracleCommand command = myOracleConnection.CreateCommand();
command.CommandText =
SchemaDifferenceFinder.Model.SQLStatements.MissingTables.DropTable;
command.CommandType = System.Data.CommandType.Text;
command.ExecuteNonQuery();
myOracleConnection.Close();
On Line 4 you find “MissingTables“. Thats a Class.
This whole Code will repeat 7 times, everything is the same, except that this Class changes, by example: “MissingColumns“. But I don’t want to copy/paste the whole code, only to replace this trifle.
What could I do? Something with generics? I could also pass parameters if needed etc. Am grateful for every solution!
Which can then be called the following way: