-
Notifications
You must be signed in to change notification settings - Fork 0
JsonIgnoreIfNullAttribute
robbyxp1 edited this page Feb 9, 2025
·
5 revisions
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.AttributeInheritance System.Object 🡒 System.Attribute 🡒 JsonIgnoreIfNullAttribute
Constructor, applies to all sets
public JsonIgnoreIfNullAttribute();Constructor with a list of sets to apply this to.
public JsonIgnoreIfNullAttribute(params string[] setnames);
setnames System.String[]
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; }