WCF Data Services Question:

Explain Service contracts?

WCF Data Services Interview Question
WCF Data Services Interview Question

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";
}
}


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?