Bearbeiten

Freigeben über


JsonPropertyInfo.IsSetNullable Property

Definition

Gets or sets a value indicating whether the input type of the setter is annotated as nullable.

public:
 property bool IsSetNullable { bool get(); void set(bool value); };
public bool IsSetNullable { get; set; }
member this.IsSetNullable : bool with get, set
Public Property IsSetNullable As Boolean

Property Value

Exceptions

The JsonPropertyInfo instance has been locked for further modification.

-or-

The current PropertyType is not a reference type or Nullable<T>.

Remarks

Contracts originating from DefaultJsonTypeInfoResolver or JsonSerializerContext, derive the value of this property from nullable reference type annotations, including annotations from attributes such as AllowNullAttribute or DisallowNullAttribute.

This property has no effect on deserialization unless the RespectNullableAnnotations property has been enabled, in which case the serializer will reject any null deserialization results.

If the property has been associated with a deserialization constructor parameter, this setting reflected the nullability annotation of the parameter and not the property setter.

Applies to