JsonIgnoreIfNullAttribute - robbyxp1/QuickJSON GitHub Wiki

QuickJSON

QuickJSON


JsonIgnoreIfNullAttribute Class

Attach to a member to indicate if the value of it is null, don't add it to JSON.
Applicable to FromObject only

public sealed class JsonIgnoreIfNullAttribute : System.Attribute

Inheritance System.Object 🡒 System.Attribute 🡒 JsonIgnoreIfNullAttribute


Constructors


JsonIgnoreIfNullAttribute.JsonIgnoreIfNullAttribute() Constructor

Constructor, applies to all sets

public JsonIgnoreIfNullAttribute();


JsonIgnoreIfNullAttribute.JsonIgnoreIfNullAttribute(string[]) Constructor

Constructor with a list of sets to apply this to.

public JsonIgnoreIfNullAttribute(params string[] setnames);
Parameters

setnames System.String(https://docs.microsoft.com/en-us/dotnet/api/System.Array 'System.Array')


Properties


JsonIgnoreIfNullAttribute.Sets Property

If non null, this belongs to an attribute set name to check. If null, applies to all sets
Attribute sets allow selection of different outputs from the same class

public string[] Sets { get; set; }
Property Value

System.String(https://docs.microsoft.com/en-us/dotnet/api/System.Array 'System.Array')