@@ -1,4 +1,7 @@ | |||||
using System.Diagnostics; | |||||
// Copyright (c) .NET Core Community. All rights reserved. | |||||
// Licensed under the MIT License. See License.txt in the project root for license information. | |||||
using System.Diagnostics; | |||||
using MongoDB.Driver; | using MongoDB.Driver; | ||||
// ReSharper disable once CheckNamespace | // ReSharper disable once CheckNamespace | ||||
@@ -69,4 +72,4 @@ namespace DotNetCore.CAP | |||||
return BeginAndJoinToTransaction(clientSessionHandle, publisher, autoCommit); | return BeginAndJoinToTransaction(clientSessionHandle, publisher, autoCommit); | ||||
} | } | ||||
} | } | ||||
} | |||||
} |
@@ -1,4 +1,7 @@ | |||||
using System.Threading; | |||||
// Copyright (c) .NET Core Community. All rights reserved. | |||||
// Licensed under the MIT License. See License.txt in the project root for license information. | |||||
using System.Threading; | |||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
using DotNetCore.CAP; | using DotNetCore.CAP; | ||||
using MongoDB.Bson; | using MongoDB.Bson; | ||||
@@ -9,13 +12,13 @@ namespace MongoDB.Driver | |||||
{ | { | ||||
internal class CapMongoDbClientSessionHandle : IClientSessionHandle | internal class CapMongoDbClientSessionHandle : IClientSessionHandle | ||||
{ | { | ||||
private readonly ICapTransaction _transaction; | |||||
private readonly IClientSessionHandle _sessionHandle; | private readonly IClientSessionHandle _sessionHandle; | ||||
private readonly ICapTransaction _transaction; | |||||
public CapMongoDbClientSessionHandle(ICapTransaction transaction) | public CapMongoDbClientSessionHandle(ICapTransaction transaction) | ||||
{ | { | ||||
_transaction = transaction; | _transaction = transaction; | ||||
_sessionHandle = (IClientSessionHandle)_transaction.DbTransaction; | |||||
_sessionHandle = (IClientSessionHandle) _transaction.DbTransaction; | |||||
} | } | ||||
public void Dispose() | public void Dispose() | ||||
@@ -68,9 +71,10 @@ namespace MongoDB.Driver | |||||
public ClientSessionOptions Options => _sessionHandle.Options; | public ClientSessionOptions Options => _sessionHandle.Options; | ||||
public IServerSession ServerSession => _sessionHandle.ServerSession; | public IServerSession ServerSession => _sessionHandle.ServerSession; | ||||
public ICoreSessionHandle WrappedCoreSession => _sessionHandle.WrappedCoreSession; | public ICoreSessionHandle WrappedCoreSession => _sessionHandle.WrappedCoreSession; | ||||
public IClientSessionHandle Fork() | public IClientSessionHandle Fork() | ||||
{ | { | ||||
return _sessionHandle.Fork(); | return _sessionHandle.Fork(); | ||||
} | } | ||||
} | } | ||||
} | |||||
} |
@@ -1,7 +1,10 @@ | |||||
using System.Data; | |||||
// Copyright (c) .NET Core Community. All rights reserved. | |||||
// Licensed under the MIT License. See License.txt in the project root for license information. | |||||
using System.Data; | |||||
using System.Diagnostics; | using System.Diagnostics; | ||||
using Microsoft.EntityFrameworkCore.Storage; | |||||
using Microsoft.EntityFrameworkCore.Infrastructure; | using Microsoft.EntityFrameworkCore.Infrastructure; | ||||
using Microsoft.EntityFrameworkCore.Storage; | |||||
// ReSharper disable once CheckNamespace | // ReSharper disable once CheckNamespace | ||||
namespace DotNetCore.CAP | namespace DotNetCore.CAP | ||||
@@ -1,4 +1,7 @@ | |||||
using System; | |||||
// Copyright (c) .NET Core Community. All rights reserved. | |||||
// Licensed under the MIT License. See License.txt in the project root for license information. | |||||
using System; | |||||
using DotNetCore.CAP; | using DotNetCore.CAP; | ||||
// ReSharper disable once CheckNamespace | // ReSharper disable once CheckNamespace | ||||
@@ -11,7 +14,7 @@ namespace Microsoft.EntityFrameworkCore.Storage | |||||
public CapEFDbTransaction(ICapTransaction transaction) | public CapEFDbTransaction(ICapTransaction transaction) | ||||
{ | { | ||||
_transaction = transaction; | _transaction = transaction; | ||||
var dbContextTransaction = (IDbContextTransaction)_transaction.DbTransaction; | |||||
var dbContextTransaction = (IDbContextTransaction) _transaction.DbTransaction; | |||||
TransactionId = dbContextTransaction.TransactionId; | TransactionId = dbContextTransaction.TransactionId; | ||||
} | } | ||||
@@ -32,4 +35,4 @@ namespace Microsoft.EntityFrameworkCore.Storage | |||||
public Guid TransactionId { get; } | public Guid TransactionId { get; } | ||||
} | } | ||||
} | |||||
} |
@@ -1,4 +1,7 @@ | |||||
using System.Data; | |||||
// Copyright (c) .NET Core Community. All rights reserved. | |||||
// Licensed under the MIT License. See License.txt in the project root for license information. | |||||
using System.Data; | |||||
using System.Diagnostics; | using System.Diagnostics; | ||||
using Microsoft.EntityFrameworkCore.Infrastructure; | using Microsoft.EntityFrameworkCore.Infrastructure; | ||||
using Microsoft.EntityFrameworkCore.Storage; | using Microsoft.EntityFrameworkCore.Storage; | ||||
@@ -8,7 +11,9 @@ namespace DotNetCore.CAP | |||||
{ | { | ||||
public class PostgreSqlCapTransaction : CapTransactionBase | public class PostgreSqlCapTransaction : CapTransactionBase | ||||
{ | { | ||||
public PostgreSqlCapTransaction(IDispatcher dispatcher) : base(dispatcher) { } | |||||
public PostgreSqlCapTransaction(IDispatcher dispatcher) : base(dispatcher) | |||||
{ | |||||
} | |||||
public override void Commit() | public override void Commit() | ||||
{ | { | ||||
@@ -67,5 +72,4 @@ namespace DotNetCore.CAP | |||||
return new CapEFDbTransaction(capTrans); | return new CapEFDbTransaction(capTrans); | ||||
} | } | ||||
} | } | ||||
} | |||||
} |
@@ -1,4 +1,7 @@ | |||||
using System; | |||||
// Copyright (c) .NET Core Community. All rights reserved. | |||||
// Licensed under the MIT License. See License.txt in the project root for license information. | |||||
using System; | |||||
using DotNetCore.CAP; | using DotNetCore.CAP; | ||||
// ReSharper disable once CheckNamespace | // ReSharper disable once CheckNamespace | ||||
@@ -11,7 +14,7 @@ namespace Microsoft.EntityFrameworkCore.Storage | |||||
public CapEFDbTransaction(ICapTransaction transaction) | public CapEFDbTransaction(ICapTransaction transaction) | ||||
{ | { | ||||
_transaction = transaction; | _transaction = transaction; | ||||
var dbContextTransaction = (IDbContextTransaction)_transaction.DbTransaction; | |||||
var dbContextTransaction = (IDbContextTransaction) _transaction.DbTransaction; | |||||
TransactionId = dbContextTransaction.TransactionId; | TransactionId = dbContextTransaction.TransactionId; | ||||
} | } | ||||
@@ -32,4 +35,4 @@ namespace Microsoft.EntityFrameworkCore.Storage | |||||
public Guid TransactionId { get; } | public Guid TransactionId { get; } | ||||
} | } | ||||
} | |||||
} |
@@ -1,4 +1,7 @@ | |||||
using System.Data; | |||||
// Copyright (c) .NET Core Community. All rights reserved. | |||||
// Licensed under the MIT License. See License.txt in the project root for license information. | |||||
using System.Data; | |||||
using System.Diagnostics; | using System.Diagnostics; | ||||
using Microsoft.EntityFrameworkCore.Infrastructure; | using Microsoft.EntityFrameworkCore.Infrastructure; | ||||
using Microsoft.EntityFrameworkCore.Storage; | using Microsoft.EntityFrameworkCore.Storage; | ||||
@@ -8,7 +11,9 @@ namespace DotNetCore.CAP | |||||
{ | { | ||||
public class SqlServerCapTransaction : CapTransactionBase | public class SqlServerCapTransaction : CapTransactionBase | ||||
{ | { | ||||
public SqlServerCapTransaction(IDispatcher dispatcher) : base(dispatcher) { } | |||||
public SqlServerCapTransaction(IDispatcher dispatcher) : base(dispatcher) | |||||
{ | |||||
} | |||||
public override void Commit() | public override void Commit() | ||||
{ | { | ||||
@@ -67,5 +72,4 @@ namespace DotNetCore.CAP | |||||
return new CapEFDbTransaction(capTrans); | return new CapEFDbTransaction(capTrans); | ||||
} | } | ||||
} | } | ||||
} | |||||
} |
@@ -1,4 +1,7 @@ | |||||
using System; | |||||
// Copyright (c) .NET Core Community. All rights reserved. | |||||
// Licensed under the MIT License. See License.txt in the project root for license information. | |||||
using System; | |||||
using DotNetCore.CAP; | using DotNetCore.CAP; | ||||
// ReSharper disable once CheckNamespace | // ReSharper disable once CheckNamespace | ||||
@@ -11,7 +14,7 @@ namespace Microsoft.EntityFrameworkCore.Storage | |||||
public CapEFDbTransaction(ICapTransaction transaction) | public CapEFDbTransaction(ICapTransaction transaction) | ||||
{ | { | ||||
_transaction = transaction; | _transaction = transaction; | ||||
var dbContextTransaction = (IDbContextTransaction)_transaction.DbTransaction; | |||||
var dbContextTransaction = (IDbContextTransaction) _transaction.DbTransaction; | |||||
TransactionId = dbContextTransaction.TransactionId; | TransactionId = dbContextTransaction.TransactionId; | ||||
} | } | ||||
@@ -32,4 +35,4 @@ namespace Microsoft.EntityFrameworkCore.Storage | |||||
public Guid TransactionId { get; } | public Guid TransactionId { get; } | ||||
} | } | ||||
} | |||||
} |