diff --git a/Frends.MicrosoftSQL.ExecuteProcedure/Frends.MicrosoftSQL.ExecuteProcedure.Tests/ScalarUnitTests.cs b/Frends.MicrosoftSQL.ExecuteProcedure/Frends.MicrosoftSQL.ExecuteProcedure.Tests/ScalarUnitTests.cs index b36a383..70bc2b7 100644 --- a/Frends.MicrosoftSQL.ExecuteProcedure/Frends.MicrosoftSQL.ExecuteProcedure.Tests/ScalarUnitTests.cs +++ b/Frends.MicrosoftSQL.ExecuteProcedure/Frends.MicrosoftSQL.ExecuteProcedure.Tests/ScalarUnitTests.cs @@ -152,15 +152,8 @@ public async Task TestExecuteProcedure_Scalar() Parameters = null }; - foreach (var level in transactionLevels) + foreach (var options in transactionLevels.Select(e => new Options { SqlTransactionIsolationLevel = e, CommandTimeoutSeconds = 2, ThrowErrorOnFailure = true})) { - var options = new Options() - { - SqlTransactionIsolationLevel = level, - CommandTimeoutSeconds = 2, - ThrowErrorOnFailure = true - }; - // Insert rows var insert = await MicrosoftSQL.ExecuteProcedure(inputInsert, options, default); Assert.IsTrue(insert.Success); diff --git a/Frends.MicrosoftSQL.ExecuteProcedure/Frends.MicrosoftSQL.ExecuteProcedure/ExecuteProcedure.cs b/Frends.MicrosoftSQL.ExecuteProcedure/Frends.MicrosoftSQL.ExecuteProcedure/ExecuteProcedure.cs index 3dda82a..5e06aa2 100644 --- a/Frends.MicrosoftSQL.ExecuteProcedure/Frends.MicrosoftSQL.ExecuteProcedure/ExecuteProcedure.cs +++ b/Frends.MicrosoftSQL.ExecuteProcedure/Frends.MicrosoftSQL.ExecuteProcedure/ExecuteProcedure.cs @@ -82,7 +82,7 @@ private static async Task ExecuteHandler(Input input, Options options, S Result result; object dataObject; SqlDataReader dataReader = null; - var table = new DataTable(); + using var table = new DataTable(); try {