diff --git a/test/EFCore.Jet.FunctionalTests/TestUtilities/JetTestStore.cs b/test/EFCore.Jet.FunctionalTests/TestUtilities/JetTestStore.cs index d97ee26..772802c 100644 --- a/test/EFCore.Jet.FunctionalTests/TestUtilities/JetTestStore.cs +++ b/test/EFCore.Jet.FunctionalTests/TestUtilities/JetTestStore.cs @@ -148,15 +148,17 @@ namespace EntityFrameworkCore.Jet.FunctionalTests.TestUtilities .Where(b => !string.IsNullOrEmpty(b)) .ToList(); - ExecuteBatch( - Connection, - false, - batches, - (command, batch) => + Execute( + Connection, command => + { + foreach (var batch in batches) { command.CommandText = batch; command.ExecuteNonQuery(); - }); + } + + return 0; + }, ""); } public void DeleteDatabase() @@ -250,46 +252,6 @@ namespace EntityFrameworkCore.Jet.FunctionalTests.TestUtilities }, state => ExecuteCommand(state.connection, state.execute, state.sql, state.useTransaction, state.parameters)); - private static void ExecuteBatch( - DbConnection connection, bool useTransaction, IEnumerable items, Action execute) - { - if (connection.State != ConnectionState.Closed) - { - connection.Close(); - } - - connection.Open(); - try - { - using (var transaction = useTransaction - ? connection.BeginTransaction() - : null) - { - foreach (var item in items) - { - new TestJetRetryingExecutionStrategy().Execute( - () => - { - using (var command = CreateCommand(connection)) - { - command.Transaction = transaction; - execute(command, item); - } - }); - } - - transaction?.Commit(); - } - } - finally - { - if (connection.State != ConnectionState.Closed) - { - connection.Close(); - } - } - } - private static T ExecuteCommand( DbConnection connection, Func execute, string sql, bool useTransaction, object[] parameters) {