欢迎来到在线考试题库网 在线考试题库官网
logo
全部科目 > 微软认证考试 > MCTS > MCTS(70-513)

单项选择题

You are developing a Windows Communication Foundation (WCF) service.One of the service operations contains the following code.private static int counter = 0;[OperationContract]public void IncrementCount(){ counter++;}You need to set a service behavior that prevents two or more threads from incrementing the counter variable at the same time.
Which code segment should you use to set the service behavior?()

    A. [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Single)]
    B. [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Single)]
    C. [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple)]
    D. [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Reentrant)]

点击查看答案

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题