Browse Source

Add file copyright

master
Savorboard 6 years ago
parent
commit
3f37a45311
8 changed files with 52 additions and 25 deletions
  1. +5
    -2
      src/DotNetCore.CAP.MongoDB/ICapTransaction.MongoDB.cs
  2. +8
    -4
      src/DotNetCore.CAP.MongoDB/IClientSessionHandle.CAP.cs
  3. +5
    -2
      src/DotNetCore.CAP.MySql/ICapTransaction.MySql.cs
  4. +6
    -3
      src/DotNetCore.CAP.MySql/IDbContextTransaction.CAP.cs
  5. +8
    -4
      src/DotNetCore.CAP.PostgreSql/ICapTransaction.PostgreSql.cs
  6. +6
    -3
      src/DotNetCore.CAP.PostgreSql/IDbContextTransaction.CAP.cs
  7. +8
    -4
      src/DotNetCore.CAP.SqlServer/ICapTransaction.SqlServer.cs
  8. +6
    -3
      src/DotNetCore.CAP.SqlServer/IDbContextTransaction.CAP.cs

+ 5
- 2
src/DotNetCore.CAP.MongoDB/ICapTransaction.MongoDB.cs View File

@@ -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);
} }
} }
}
}

+ 8
- 4
src/DotNetCore.CAP.MongoDB/IClientSessionHandle.CAP.cs View File

@@ -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();
} }
} }
}
}

+ 5
- 2
src/DotNetCore.CAP.MySql/ICapTransaction.MySql.cs View File

@@ -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


+ 6
- 3
src/DotNetCore.CAP.MySql/IDbContextTransaction.CAP.cs View File

@@ -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; }
} }
}
}

+ 8
- 4
src/DotNetCore.CAP.PostgreSql/ICapTransaction.PostgreSql.cs View File

@@ -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);
} }
} }

}
}

+ 6
- 3
src/DotNetCore.CAP.PostgreSql/IDbContextTransaction.CAP.cs View File

@@ -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; }
} }
}
}

+ 8
- 4
src/DotNetCore.CAP.SqlServer/ICapTransaction.SqlServer.cs View File

@@ -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);
} }
} }

}
}

+ 6
- 3
src/DotNetCore.CAP.SqlServer/IDbContextTransaction.CAP.cs View File

@@ -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; }
} }
}
}

Loading…
Cancel
Save