public static IDtcTransaction GetDtcTransaction(Transaction transaction)
{
if (null == transaction)
{
throw new ArgumentNullException(nameof(transaction));
}
TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
if (etwLog.IsEnabled())
{
etwLog.MethodEnter(TraceSourceType.TraceSourceDistributed, "TransactionInterop.GetDtcTransaction");
}
DistributedTransaction dTx = ConvertToDistributedTransaction(transaction);
IDtcTransaction transactionNative = dTx.GetDtcTransaction();
if (etwLog.IsEnabled())
{
etwLog.MethodExit(TraceSourceType.TraceSourceDistributed, "TransactionInterop.GetDtcTransaction");
}
return transactionNative;
}