Skip to content

Commit 20e2993

Browse files
committed
SqlCommand must be associated with tx manually (but not SqliteCommand)
1 parent e4c032b commit 20e2993

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Directory.Build.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<PropertyGroup>
44
<Copyright>(c) $([System.DateTime]::Now.Year), Pawel Gerr. All rights reserved.</Copyright>
5-
<VersionPrefix>9.2.0</VersionPrefix>
6-
<Authors>Pawel Gerr</Authors>
5+
<VersionPrefix>9.2.1</VersionPrefix>
6+
<Authors>Pawel Gerr</Authors>
77
<GenerateDocumentationFile>true</GenerateDocumentationFile>
88
<PackageProjectUrl>https://dev.azure.com/pawelgerr/Thinktecture.EntityFrameworkCore</PackageProjectUrl>
99
<PackageIcon>icon.png</PackageIcon>
@@ -12,7 +12,7 @@
1212
<RepositoryUrl>https://pawelgerr@dev.azure.com/pawelgerr/Thinktecture.EntityFrameworkCore/_git/Thinktecture.EntityFrameworkCore</RepositoryUrl>
1313
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1414
<RootNamespace>Thinktecture</RootNamespace>
15-
<TargetFrameworks>net8.0;net9.0;</TargetFrameworks>
15+
<TargetFrameworks>net8.0;net9.0;</TargetFrameworks>
1616
<LangVersion>13.0</LangVersion>
1717
<Nullable>enable</Nullable>
1818
<NoWarn>$(NoWarn);CA1303;MSB3884;</NoWarn>
@@ -22,7 +22,7 @@
2222
<VSTestLogger>trx%3bLogFileName=$(MSBuildProjectName).trx</VSTestLogger>
2323
<VSTestResultsDirectory>$(MSBuildThisFileDirectory)test-results/$(TargetFramework)</VSTestResultsDirectory>
2424
</PropertyGroup>
25-
25+
2626
<ItemGroup>
2727
<Using Include="Microsoft.EntityFrameworkCore" />
2828
</ItemGroup>

src/Thinktecture.EntityFrameworkCore.SqlServer/EntityFrameworkCore/TempTables/SqlServerTempTableReference.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System.Data;
22
using System.Data.Common;
3-
using System.Diagnostics.CodeAnalysis;
43
using Microsoft.EntityFrameworkCore.Diagnostics;
54
using Microsoft.EntityFrameworkCore.Infrastructure;
65
using Microsoft.EntityFrameworkCore.Storage;
@@ -121,6 +120,7 @@ public async ValueTask DisposeAsync()
121120
return null;
122121

123122
command = connection.CreateCommand();
123+
command.Transaction = _database.CurrentTransaction?.GetDbTransaction();
124124
command.CommandText = $"""
125125
IF(OBJECT_ID('tempdb..{Name}') IS NOT NULL)
126126
DROP TABLE {_sqlGenerationHelper.DelimitIdentifier(Name)};

0 commit comments

Comments
 (0)