Data Contract in WCF

In my earlier blog, I wrote about Other Contracts. Please refer this link Contracts in WCF
Here we will learn about Data Contract.
It is used to define the data which will be exchanged between client and server.
A simple Data Contract with Data Member will look like this.

public class Product
    private int _ProductID;
    private string _ProductName;
    public string PName
        get { return _ProductName; }
        set { _ProductName = value; }

    public int PID
        get { return _ProductID; }
        set { _ProductID = value; }


In next blog, I will explain about DataContract Serialization.

Share on Google Plus

Please write your comment below. Share this blog on Social media.


Post a Comment

Dear Readers, Please post your valuable feedback in the comment section if you like this blog or if you have any suggestions. I would love to hear the same from you. Thanks