WCF Data Services Question: Download WCF Data Services PDF

Explain Service contracts?

Tweet Share WhatsApp

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 PDF Read All 26 WCF Data Services Questions
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?