WCF Data Services Question:
Download Questions PDF

Explain Service contracts?

Answer:

Describe which operations the client can perform on the service.
There are two types of Service Contracts.
ServiceContract - This attribute is used to define the Interface.
OperationContract - This attribute is used to define the method inside Interface.

[ServiceContract]
interface IMyContract
{
[OperationContract]
string MyMethod( );
}
class MyService : IMyContract
{
public string MyMethod( )
{
return "Hello World";
}
}

Download WCF Data Services Interview Questions And Answers PDF

Previous QuestionNext Question
Do you know what is address in WCF and how many types of transport schemas are there in WCF?Explain Data contracts?