I understand that we can have more controls on a class if we use datacontract, however, consider the following 2 cases
[DataContract]
public class Customer
{
[DataMember]
public string CustomerName {get; set;}
[DataMember]
public int Age{get; set;}
}
and
public class Customer
{
public string CustomerName {get; set;}
public int Age{get; set;}
}
They both get serialized correctly on .net client. And personally I do not use second example. Can anybody point me the differences in the 2 classes? I meant to send all public properties in both classes.