IgnoreDataMember
IgnoreDataMember is an attribute used in the .NET framework to control data contract serialization. Defined in System.Runtime.Serialization, it marks a member of a data contract to be ignored by the DataContractSerializer and DataContractJsonSerializer. When a type is serialized as a data contract, members marked with IgnoreDataMember are excluded from the serialized output.
The attribute is applied to fields or properties. It is commonly used to omit sensitive information, large
In typical data contract usage, a class is decorated with DataContract and the members intended for serialization
{
public string UserName { get; set; }
public string Password { get; set; }
}
Limitations: IgnoreDataMember affects DataContractSerializer and related WCF JSON serialization. Other serialization frameworks (such as JSON.NET or