Reputation: 11
Can somebody please explain me the main use of data contract. I am not very much clear definitions given on MSDN and many more website Can you please explain me with a scenario or example so that it can be understood in a better way.
Thanks, Monika
Upvotes: 1
Views: 288
Reputation: 1631
I would recommend you a book i used to learn the basics and understand how WCF works and what are the contracts and what are the differences between them.
Wrox - Professional WCF 4: Windows Communication Foundation with .NET 4
It's a great book and easy to understand and has a lot of examples for you.
DataContract is used on a class and DataMemeber is used on it's properties so when you call the WCF service it uses this Contracts to serialize and send your class between the Client and Server side. With the Contracts your Client side can use then the class and it's data.
Upvotes: 1