Which code segment should you use?

You are creating a Windows Communication Foundation (WCF) service. You do not want to expose the internal implementation at the service layer.
You need to expose the following class as a service named Arithmetic with an operation named Sum.
public class Calculator
{
public int Add(int x, int y)
{
}
}
Which code segment should you use?

You are creating a Windows Communication Foundation (WCF) service. You do not want to expose the internal implementation at the service layer.
You need to expose the following class as a service named Arithmetic with an operation named Sum.
public class Calculator
{
public int Add(int x, int y)
{
}
}
Which code segment should you use?

A.
[ServiceContract(Namespace=”Arithmetic”)]
public class Calculator
{
[OperationContract(Action=”Sum”)]
public int Add(int x, int y)
{

}
}

B.
[ServiceContract(ConfigurationName=”Arithmetic”)]
public class Calculator
{
[OperationContract(Action=”Sum”)]
public int Add(int x, int y)
{

}
}

C.
[ServiceContract(Name=”Arithmetic”)]
public class Calculator
{
[OperationContract(Name=”Sum”)]
public int Add(int x, int y)
{

}
}

D.
[ServiceContract(Name=”Arithmetic”)]
public class Calculator
{
[OperationContract(ReplyAction=”Sum”)]
public int Add(int x, int y)
{

}
}



Leave a Reply 0

Your email address will not be published. Required fields are marked *