When we create WCF Service, we have SrviceContract (Interface), OperationCOntract(Methods) and DataContract(Class types).
I am wondering if we can have OperationContract without DataContract. If yes, any Example would be great help.
Appreciate your time.
Thanks
The DataContract
attribute just represents a class that will be used in signatures in your service. So if your service doesn't need to refer to any of your classes, you won't have a DataContract
attribute anywhere.
For example, if you have just methods that accept and return primitive types like strings or numbers, then you wouldn't have to define any of your own classes.