You have a dataContract class with an additional message.
[DataMember(EmitDefaultValue = false)]
public int salary = 0;
DataContract serializer ignores such an element when the default value.
MSDN Recommendation: It is not recommended to set the EmitDefaultValue property to false. You should do this only if there is a definite need to do this, for example, to ensure compatibility or reduce data size.
You also have the IsRequired property in DataMember, setting it to false and EmitDefaultValue by reducing transport and serialization costs.
source share