JsonSerializerOptions.PropertyNameCaseInsensitive 属性

定义

获取或设置一个值,该值指示属性的名称在反序列化期间是否使用不区分大小写的比较。 默认值为 false

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

属性值

true 如果属性名称不区分大小写,则为比较;否则,为 false.

注解

与不区分大小写的比较(即何时PropertyNameCaseInsensitivetrue)相关的性能成本。

有关详细信息,请参阅 如何启用与 System.Text.Json 匹配的不区分大小写的属性名称

适用于