试题详情
单项选择题 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
  • 关注下方微信公众号,在线模考后查看

热门试题