Utf8JsonWriter.WriteNull 方法
定义
重载
| WriteNull(ReadOnlySpan<Byte>) |
将指定为只读字节范围的属性名称和 JSON 文本 null 写入 JSON 对象的名称/值对。Writes a property name specified as a read-only span of bytes and the JSON literal null as part of a name/value pair of a JSON object. |
| WriteNull(ReadOnlySpan<Char>) |
将指定为只读字符范围的属性名称和 JSON 文本 null 写入 JSON 对象的名称/值对。Writes a property name specified as a read-only character span and the JSON literal null as part of a name/value pair of a JSON object. |
| WriteNull(String) |
将指定为字符串的属性名称和 JSON 文本 null 写入 JSON 对象的名称/值对。Writes a property name specified as a string and the JSON literal null as part of a name/value pair of a JSON object. |
| WriteNull(JsonEncodedText) |
将预编码的属性名称和 JSON 文本 null 写入 JSON 对象的名称/值对。Writes the pre-encoded property name and the JSON literal null as part of a name/value pair of a JSON object. |
WriteNull(ReadOnlySpan<Byte>)
将指定为只读字节范围的属性名称和 JSON 文本 null 写入 JSON 对象的名称/值对。Writes a property name specified as a read-only span of bytes and the JSON literal null as part of a name/value pair of a JSON object.
public:
void WriteNull(ReadOnlySpan<System::Byte> utf8PropertyName);
public void WriteNull (ReadOnlySpan<byte> utf8PropertyName);
member this.WriteNull : ReadOnlySpan<byte> -> unit
Public Sub WriteNull (utf8PropertyName As ReadOnlySpan(Of Byte))
参数
- utf8PropertyName
- ReadOnlySpan<Byte>
要编写的 JSON 对象的 UTF-8 编码属性名称。The UTF-8 encoded property name of the JSON object to be written.
例外
指定的属性名称过长。The specified property name is too large.
系统已启用验证,该编写操作将生成无效的 JSON。Validation is enabled, and the write operation would produce invalid JSON.
注解
在写入之前,属性名称经过转义。The property name is escaped before writing.
适用于
WriteNull(ReadOnlySpan<Char>)
将指定为只读字符范围的属性名称和 JSON 文本 null 写入 JSON 对象的名称/值对。Writes a property name specified as a read-only character span and the JSON literal null as part of a name/value pair of a JSON object.
public:
void WriteNull(ReadOnlySpan<char> propertyName);
public void WriteNull (ReadOnlySpan<char> propertyName);
member this.WriteNull : ReadOnlySpan<char> -> unit
Public Sub WriteNull (propertyName As ReadOnlySpan(Of Char))
参数
- propertyName
- ReadOnlySpan<Char>
要进行转码并写为 UTF-8 的 JSON 对象的 UTF-16 编码属性名称。The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.
例外
指定的属性名称过长。The specified property name is too large.
系统已启用验证,该编写操作将生成无效的 JSON。Validation is enabled, and the write operation would produce invalid JSON.
注解
在写入之前,属性名称经过转义。The property name is escaped before writing.
适用于
WriteNull(String)
将指定为字符串的属性名称和 JSON 文本 null 写入 JSON 对象的名称/值对。Writes a property name specified as a string and the JSON literal null as part of a name/value pair of a JSON object.
public:
void WriteNull(System::String ^ propertyName);
public void WriteNull (string propertyName);
member this.WriteNull : string -> unit
Public Sub WriteNull (propertyName As String)
参数
- propertyName
- String
要进行转码并写为 UTF-8 的 JSON 对象的 UTF-16 编码属性名称。The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.
例外
指定的属性名称过长。The specified property name is too large.
系统已启用验证,该编写操作将生成无效的 JSON。Validation is enabled, and the write operation would produce invalid JSON.
propertyName 参数为 null。The propertyName parameter is null.
注解
在写入之前,属性名称经过转义。The property name is escaped before writing.
适用于
WriteNull(JsonEncodedText)
将预编码的属性名称和 JSON 文本 null 写入 JSON 对象的名称/值对。Writes the pre-encoded property name and the JSON literal null as part of a name/value pair of a JSON object.
public:
void WriteNull(System::Text::Json::JsonEncodedText propertyName);
public void WriteNull (System.Text.Json.JsonEncodedText propertyName);
member this.WriteNull : System.Text.Json.JsonEncodedText -> unit
Public Sub WriteNull (propertyName As JsonEncodedText)
参数
- propertyName
- JsonEncodedText
要进行转码并写为 UTF-8 的 JSON 对象的 JSON 编码属性名称。The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.
例外
系统已启用验证,此方法将导致编写无效的 JSON。Validation is enabled, and this method would result in writing invalid JSON.
注解
创建实例时,属性名称应已转义 JsonEncodedText 。The property name should already be escaped when the instance of JsonEncodedText was created.