Answers

Question and Answer:

  Home  WCF Data Services

⟩ Explain Service contracts?

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

}

}

 191 views

More Questions for you: