Sfoglia il codice sorgente

tweak transaction extension method

master
Savorboard 6 anni fa
parent
commit
690380a3cc
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. +5
    -0
      src/DotNetCore.CAP.MongoDB/ICapTransaction.MongoDB.cs

+ 5
- 0
src/DotNetCore.CAP.MongoDB/ICapTransaction.MongoDB.cs Vedi File

@@ -45,6 +45,11 @@ namespace DotNetCore.CAP
public static ICapTransaction Begin(this ICapTransaction transaction,
IClientSessionHandle dbTransaction, bool autoCommit = false)
{
if (!dbTransaction.IsInTransaction)
{
dbTransaction.StartTransaction();
}
transaction.DbTransaction = dbTransaction;
transaction.AutoCommit = autoCommit;



Caricamento…
Annulla
Salva