When to use DataContract and DataMember attributes?

I am very confused about the DataContract attribute in WCF. As per my knowledge it is used for serializating user defined type like classes. I wrote one class which is exposed at client side like this. [DataContract] public class Contact { [DataMember] public int Roll { get; set; } [DataMember] public string Name { get; … Read more