nerdexam
Microsoft

70-513 · Question #85

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…

The correct answer is A. [ServiceBehavior(. See the full explanation below for the reasoning.

Question

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?

Options

  • A[ServiceBehavior(
  • B[ServiceBehavior(
  • C[ServiceBehavior(
  • D[ServiceBehavior(

How the community answered

(49 responses)
  • A
    82% (40)
  • B
    12% (6)
  • C
    4% (2)
  • D
    2% (1)

Community Discussion

No community discussion yet for this question.

Full 70-513 Practice