語言

JsonParameterInfo.IsNullable 屬性

定義

會得到一個值,表示建構子參數是否被註解為可空。

public:
 property bool IsNullable { bool get(); };
public bool IsNullable { get; }
member this.IsNullable : bool
Public ReadOnly Property IsNullable As Boolean

屬性值

備註

來自 DefaultJsonTypeInfoResolver 或 JsonSerializerContext的合約,從可空的參考類型註解推導出此參數的值,包括屬性 AllowNullAttribute 如 或 DisallowNullAttribute的註解。 此特性對反序列化沒有影響,除非 RespectNullableAnnotations 該特性已被啟用,若啟用此功能,序列化器將拒絕任何 null 反序列化結果。 此設定與相關 IsSetNullable 屬性同步。

適用於