Use name ShouldSerialize {PropertyName} defining a common method, the method will return bool within the class. May determine whether the sequence of fields in accordance with PropertyName return bool value.
Such as:
public int Age{get;set;}
public string Name{get;set;}
public bool ShouldSerializeName(){
return !string.IsNullOrEmpty(Name);
}
When the return sequence of name is an empty string {Age: X,}, the sequence returns when the name of the string is not empty {Age: X, Name: 'XXX'},