What is an Operation Contract in WCF?

Technology CommunityCategory: WCFWhat is an Operation Contract in WCF?
VietMX Staff asked 3 years ago

An operation contract is defined within a service contract. It defines the parameters and return type of an operation. An operation contract can also defines operation-level settings, like as the transaction flow of the operation, the directions of the operation (one-way, two-way, or both ways), and fault contract of the operation.

[ServiceContract]
interface IMyContract { 
    [FaultContract(typeof(MyFaultContract))]
    [OperationContract]
	string MyMethod();
}