|
|
@@ -2,14 +2,16 @@ |
|
|
|
// Licensed under the MIT License. See License.txt in the project root for license information. |
|
|
|
|
|
|
|
using System; |
|
|
|
using System.Data.Common; |
|
|
|
using System.Threading; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using DotNetCore.CAP; |
|
|
|
using Microsoft.EntityFrameworkCore.Infrastructure; |
|
|
|
|
|
|
|
// ReSharper disable once CheckNamespace |
|
|
|
namespace Microsoft.EntityFrameworkCore.Storage |
|
|
|
{ |
|
|
|
internal class CapEFDbTransaction : IDbContextTransaction |
|
|
|
internal class CapEFDbTransaction : IDbContextTransaction, IInfrastructure<DbTransaction> |
|
|
|
{ |
|
|
|
private readonly ICapTransaction _transaction; |
|
|
|
|
|
|
@@ -51,5 +53,14 @@ namespace Microsoft.EntityFrameworkCore.Storage |
|
|
|
{ |
|
|
|
return new ValueTask(Task.Run(() => _transaction.Dispose())); |
|
|
|
} |
|
|
|
|
|
|
|
public DbTransaction Instance |
|
|
|
{ |
|
|
|
get |
|
|
|
{ |
|
|
|
var dbContextTransaction = (IDbContextTransaction) _transaction.DbTransaction; |
|
|
|
return dbContextTransaction.GetDbTransaction(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |