You create a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
You write the following code segment.
01 [ServiceContract]
02 public class MyService
03 {
04 [OperationContract]
05
06 public void MyMethod()
07 {
08 …
09 }
10 }
The service uses a transactional binding. The TransactionFlow property for the binding is set to true
You need to ensure that the MyMethod method meets the following requirements:
The method uses a client-side transaction if a client-side transaction exists.
The method uses a server-side transaction if a client-side transaction does not exist.
Which code segment should you insert at line 05?
A.
[OperationBehavior(TransactionScopeRequired=true)]
[TransactionFlow(TransactionFlowOption.Allowed)]
B.
[OperationBehavior(TransactionScopeRequired=true)]
[TransactionFlow(TransactionFlowOption. Mandatory)]
C.
[OperationBehavior(TransactionScopeRequired=false)]
[TransactionFlow(TransactionFlowOption. Allowed)]
D.
[OperationBehavior(TransactionScopeRequired=false)]
[TransactionFlow(TransactionFlowOption. Mandatory)]