語言

JsonPropertyInfo.IsGetNullable 屬性

定義

取得或設定一個值,表示該取物的回傳類型是否被註解為可空。

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

屬性值

例外狀況

該 JsonPropertyInfo 實例已被鎖定,無法進一步修改。

-或-

電流 PropertyType 不是參考型別或 Nullable<T>。

備註

來自DefaultJsonTypeInfoResolver或 JsonSerializerContext的合約,從可空的參考類型註解推導出此屬性的價值,包括屬性NotNullAttributeMaybeNullAttribute如 或 的註解。

此特性對序列化不影響,除非啟用此功能 RespectNullableAnnotations ,否則序列化器會拒絕接收器回傳的任何 null 值。

適用於