Saturday, September 10, 2016

JsonIgnore and IgnoreDataMember

[JsonIgnore]
This attribute in the NewtonSoft.Json namespace can be slapped on a getsetter at a POCO in C# to keep it from being serialized to JSON and to keep JSON handed in from being mapped to it.

 
 

[IgnoreDataMember]
This attribute in the System.Runtime.Serialization namespace is something similar and includes XML concerns too.

No comments:

Post a Comment