Monday, August 9, 2010

The OperationContract Attribute

The OperationContract Attribute:


The OperationContract Attribute, also defined in the System.ServiceModel namespace, can be applied only to methods. It is used to declare the method as belonging to a Service contract.

As with the ServiceContractAttribute, the OperationContractAttribute can be declared with a variety of named parameters that provide control over the service description and message formats.

• Name Specifies a different name for the operation instead of using the default, which is the method name.

Eg:
[OperationContract]
int Add(int a, int b);

No comments: