internal static DistributedTransaction ConvertToDistributedTransaction(Transaction transaction)
{
if (null == transaction)
{
throw new ArgumentNullException(nameof(transaction));
}
if (transaction.Disposed)
{
throw new ObjectDisposedException(nameof(Transaction));
}
if (transaction._complete)
{
throw TransactionException.CreateTransactionCompletedException(transaction.DistributedTxId);
}
DistributedTransaction distributedTx = transaction.Promote();
if (distributedTx == null)
{
throw DistributedTransaction.NotSupported();
}
return distributedTx;
}