what is the difference between class without DataContract attributes:
public class BankOperationResult
{
public int CurrentAmount { get; set; }
public bool Success { get; set; }
}
and the same class with DataContract attributes:
[DataContract]
public class BankOperationResult
{
[DataMember]
public int CurrentAmount { get; set; }
[DataMember]
public bool Success { get; set; }
}
I mean, does WCF treats those two types in different way when encoding etc.?
With or without those attributes my WCF service works...
Thanks, Pawel
public int MyValue { get; set; }
and will name them<MyValue>k__BackingField
. Adding the DataContract and DataMember attributes explicitly will have the DataContractSerializer forego the private field serialization. – Therrien