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(Name=”Arithmetic”)] public class Calculator {
[OperationContract(Name=”Sum”)] public int Add(int x, int y) { …. }}

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

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

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

Explanation:



Leave a Reply 0

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