
Explanation/Reference:
Box 1: [ServiceContract]
Each interface must have the ServiceContractAttribute applied toit and each operation must have the OperationContractAttribute attribute applied to it. If a method within an interface that has the ServiceContractAttribute attribute does not have the OperationContractAttribute attribute, that method is not exposed by the service.
Note: When using attributes to annotate an interface, member, or class, you can drop the "Attribute" part from the attribute name. So ServiceContractAttribute becomes
[ServiceContract] in C#.
Box 2: [TransactionFlow(TransactionFlowOption.Mandatory.
The service must have a transaction scope.
Transactions must flow from the client to the server.
Note: The TransactionFlow attribute specifies whether the operation supports transactions. There are three possible values for this attribute:
*Mandatory : In order to call this operation, the client must create a transaction.
* NotAllowed : The operation cannot participate in a transaction. This is the default value for this attribute.
* Allowed : The operation will participate in a transaction if the client creates one.
Box 3: [ServiceBehavior(TransactionTimeout = "00:00:30")]
Define the ServiceBehavior for the interface. Use "00:00:30", not 30, to define that operations must have
30 seconds timeouts.
Box 4: [OperationsBehaviour(TransactionScopeRequired=True)
We must decorate the Foo method with TransactionScopeRequired attribute.
The correct syntax is [OperationsBehaviour(TransactionScopeRequired=True), not
[OperationsBehaviour.required]
References: https://msdn.microsoft.com/en-us/library/ms731835(v=vs.110).aspx
https://msdn.microsoft.com/en-us/library/ff384250.aspx