| 70-503) Exam |
| 70-503) - Exam Information |
| Question of the day |
You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. You create the following service contract. [ServiceContract] public interface IMyService { [OperationContract] void DoSomething(); } The service will not use any external resources. You need to ensure that the calls to the DoSomething operation are thread-safe. What are the two possible service implementations that you can use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
Answer(s)
[ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Single,InstanceContextMode=InstanceContextMode.Single)]public class ServiceImpl : IMyService{public voidDoSomething() { }}
{ }}D. [ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Multiple,InstanceContextMode=InstanceContextMode.PerCall)]public class ServiceImpl : IMyService{public voidDoSomething() { }}