Is it possible to tell dynamically to ignore the property using JsonIgnore? As json message sometimes need to ignore a field. For example
Class A {
[JsonProperty("Random1")]
public string somerandomfield1 {get; set;}
[JsonProperty("Random2")]
public string somerandomfield2 {get; set;}
}
However sometimes Class A needs to ignore field "somerandomfield1" while building a json message.
Class A {
[JsonIgnore]
public string somerandomfield1 {get; set;}
[JsonProperty("Random2")]
public string somerandomfield2 {get; set;}
}