Rediger

Del via


JsonPropertyInfo.IsGetNullable Property

Definition

Gets or sets a value indicating whether the return type of the getter is annotated as nullable.

public:
 property bool IsGetNullable { bool get(); void set(bool value); };
public bool IsGetNullable { get; set; }
member this.IsGetNullable : bool with get, set
Public Property IsGetNullable 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 NotNullAttribute or MaybeNullAttribute.

This property has no effect on serialization unless the RespectNullableAnnotations property has been enabled, in which case the serializer will reject any null values returned by the getter.

Applies to