本文整理汇总了C#中System.Transactions.Transaction.Promote方法的典型用法代码示例。如果您正苦于以下问题:C# Transaction.Promote方法的具体用法?C# Transaction.Promote怎么用?C# Transaction.Promote使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Transactions.Transaction
的用法示例。
在下文中一共展示了Transaction.Promote方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConvertToOletxTransaction
internal static OletxTransaction ConvertToOletxTransaction(Transaction transaction)
{
if (null == transaction)
{
throw new ArgumentNullException("transaction");
}
if (transaction.Disposed)
{
throw new ObjectDisposedException("Transaction");
}
if (transaction.complete)
{
throw TransactionException.CreateTransactionCompletedException(System.Transactions.SR.GetString("TraceSourceLtm"));
}
return transaction.Promote();
}
示例2: ConvertToOletxTransaction
internal static OletxTransaction ConvertToOletxTransaction(
Transaction transaction
)
{
if ( null == transaction )
{
throw new ArgumentNullException( "transaction" );
}
if ( transaction.Disposed )
{
throw new ObjectDisposedException( "Transaction" );
}
if ( transaction.complete )
{
throw TransactionException.CreateTransactionCompletedException( SR.GetString( SR.TraceSourceLtm ) );
}
OletxTransaction oletxTx = transaction.Promote();
System.Diagnostics.Debug.Assert( oletxTx != null, "transaction.Promote returned null instead of throwing." );
return oletxTx;
}
示例3: ConvertToDistributedTransaction
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(SR.TraceSourceLtm, transaction.DistributedTxId);
}
DistributedTransaction distributedTx = transaction.Promote();
if (distributedTx == null)
{
throw DistributedTransaction.NotSupported();
}
return distributedTx;
}