In my earlier blog, I wrote about Other Contracts. Please refer this link Contracts in WCF
Learn 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.
A simple Data Contract with Data Member will look like this.
[DataContract]
public class Product
{
private int _ProductID;
private string _ProductName;
[DataMember]
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.
Related blogs to WCF Service-
- Introduction to WCF
- ABC of WCF
- Basics of WCF Architecture
- WCF vs Web Service
- What is XML serialization?
- WCF Binding
- Create first WCF application
- Fault Contract in
- WCF Data Contract vs Message Contract
- Message Contract
- Data Contract Serialization and De-Serialization
- Data Contract in WCF
- Operation Contract in WCF
- Service Contract in WCF
- How to host a WCF service in IIS?
- WAS Hosting in WCF
- Self Hosting in WCF
- How to create WCF RESTful Service.