You are integrating a Windows Communication Foundation (WCF) service within an enterprise-wide Service Oriented Architecture (SOA).Your service has the following service contract: [ServiceContract]public class CreditCardConfirmationService { [OperationContract] boolean ConfirmCreditCard(string ccNumber); double OrderAmount(int orderNumber);} You need to allow the code in the ConfirmCreditCard method to participate automatically in existing transactions.If there is no existing transaction, a new transaction must be created automatically. What should you do?()
- A、Inside the ConfirmCreditCard method, surround the code that must participate in the transaction with a using(new TransactionScope()) block.
- B、Inside the ConfirmCreditCard method, surround the code that must participate in the transaction with a using(new CommittableTransaction()) block.
- C、Add an [OperationBehavior(TransactionScopeRequired=true)] attribute to the ConfirmCreditCard method.
- D、Add an [OperationBehavior(TransactionAutoComplete=true)] attribute to the ConfirmCreditCard method.
正确答案:C
答案解析:有
微信扫一扫手机做题