Utf8JsonWriter.WriteNull 方法

定义

重载

名称 说明
WriteNull(ReadOnlySpan<Byte>)

将指定为只读字节范围的属性名称,并将 JSON 文本 null 作为 JSON 对象的名称/值对的一部分写入。

WriteNull(ReadOnlySpan<Char>)

将指定为只读字符范围的属性名称,并将 JSON 文本 null 作为 JSON 对象的名称/值对的一部分写入。

WriteNull(String)

写入指定为字符串的属性名称,并将 JSON 文本 null 作为 JSON 对象的名称/值对的一部分。

WriteNull(JsonEncodedText)

将预编码的属性名称和 JSON 文本 null 作为 JSON 对象的名称/值对的一部分写入。

WriteNull(ReadOnlySpan<Byte>)

Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs

将指定为只读字节范围的属性名称,并将 JSON 文本 null 作为 JSON 对象的名称/值对的一部分写入。

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 编码属性名称。

例外

指定的属性名称太大。

验证已启用,写入操作将生成无效的 JSON。

注解

属性名称在写入之前进行转义。

适用于

WriteNull(ReadOnlySpan<Char>)

Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs

将指定为只读字符范围的属性名称,并将 JSON 文本 null 作为 JSON 对象的名称/值对的一部分写入。

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 编码属性名称。

例外

指定的属性名称太大。

验证已启用,写入操作将生成无效的 JSON。

注解

属性名称在写入之前进行转义。

适用于

WriteNull(String)

Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs

写入指定为字符串的属性名称,并将 JSON 文本 null 作为 JSON 对象的名称/值对的一部分。

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 编码属性名称。

例外

指定的属性名称太大。

验证已启用,写入操作将生成无效的 JSON。

参数 propertyNamenull.

注解

属性名称在写入之前进行转义。

适用于

WriteNull(JsonEncodedText)

Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs
Source:
Utf8JsonWriter.WriteProperties.Literal.cs

将预编码的属性名称和 JSON 文本 null 作为 JSON 对象的名称/值对的一部分写入。

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 编码属性名称。

例外

验证已启用,此方法将导致编写无效的 JSON。

注解

创建实例 JsonEncodedText 时,应已转义属性名称。

适用于