You work as a Windows Developer for PassGuide.com. You are required to handle orders placed
for the company’s IT department. You are required to write the following code for a service
contract:
<ServiceContract>
Public Interface IOrderManager
<OperationContract>
Sub OrderPlaced(ordered As Integer)
EndSub
End Interface
You want to make sure that the OrderPlaced method uses transactions, and if no exception
occurs, then regulates and commits automatically. Which of the following implementations would
you use?
A.
<TransactionFlow(TransactionFlowOption.NotAllowed)>
<OperationBehavior>
Public Sub OrderPlaced(ordered As Integer)
End Sub
B.
<TransactionFlow(TransactionFlowOption.Allowed)> <OperationBehavior>
(TransactionScopeRequired:=False, TransactionAutoComplete:=True)] Public Sub OrderPlaced
(ordered As Integer) End Sub
C.
<TransactionFlow(TransactionFlowOption.NotAllowed)>
<OperationBehavior>
Public Sub OrderPlaced(ordered As String)
End Sub
D.
<TransactionFlow(TransactionFlowOption.Allowed)> <OperationBehavior>
(TransactionScopeRequired:=True, TransactionAutoComplete:=False)] Public Sub OrderPlaced
(ordered As Integer) End Sub
Explanation: