Utf8JsonWriter.WritePropertyName Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
WritePropertyName(JsonEncodedText) |
Writes the pre-encoded property name (as a JSON string) as the first part of a name/value pair of a JSON object. |
WritePropertyName(String) |
Writes the property name (as a JSON string) as the first part of a name/value pair of a JSON object. |
WritePropertyName(ReadOnlySpan<Byte>) |
Writes the UTF-8 property name (as a JSON string) as the first part of a name/value pair of a JSON object. |
WritePropertyName(ReadOnlySpan<Char>) |
Writes the property name (as a JSON string) as the first part of a name/value pair of a JSON object. |
WritePropertyName(JsonEncodedText)
Writes the pre-encoded property name (as a JSON string) as the first part of a name/value pair of a JSON object.
public:
void WritePropertyName(System::Text::Json::JsonEncodedText propertyName);
public void WritePropertyName (System.Text.Json.JsonEncodedText propertyName);
member this.WritePropertyName : System.Text.Json.JsonEncodedText -> unit
Public Sub WritePropertyName (propertyName As JsonEncodedText)
Parameters
- propertyName
- JsonEncodedText
The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.
Exceptions
Validation is enabled, and this write operation would produce invalid JSON.
Remarks
The property name should already be escaped when the instance of JsonEncodedText was created.
Applies to
WritePropertyName(String)
Writes the property name (as a JSON string) as the first part of a name/value pair of a JSON object.
public:
void WritePropertyName(System::String ^ propertyName);
public void WritePropertyName (string propertyName);
member this.WritePropertyName : string -> unit
Public Sub WritePropertyName (propertyName As String)
Parameters
- propertyName
- String
The property name of the JSON object to be transcoded and written as UTF-8.
Exceptions
The specified property name is too large.
Validation is enabled, and this write operation would produce invalid JSON.
propertyName
is null
.
Remarks
The property name is escaped before writing.
Applies to
WritePropertyName(ReadOnlySpan<Byte>)
Writes the UTF-8 property name (as a JSON string) as the first part of a name/value pair of a JSON object.
public:
void WritePropertyName(ReadOnlySpan<System::Byte> utf8PropertyName);
public void WritePropertyName (ReadOnlySpan<byte> utf8PropertyName);
member this.WritePropertyName : ReadOnlySpan<byte> -> unit
Public Sub WritePropertyName (utf8PropertyName As ReadOnlySpan(Of Byte))
Parameters
- utf8PropertyName
- ReadOnlySpan<Byte>
The UTF-8 encoded property name of the JSON object to be written.
Exceptions
The specified property name is too large.
Validation is enabled, and this write operation would produce invalid JSON.
Remarks
The property name is escaped before writing.
Applies to
WritePropertyName(ReadOnlySpan<Char>)
Writes the property name (as a JSON string) as the first part of a name/value pair of a JSON object.
public:
void WritePropertyName(ReadOnlySpan<char> propertyName);
public void WritePropertyName (ReadOnlySpan<char> propertyName);
member this.WritePropertyName : ReadOnlySpan<char> -> unit
Public Sub WritePropertyName (propertyName As ReadOnlySpan(Of Char))
Parameters
- propertyName
- ReadOnlySpan<Char>
The property name of the JSON object to be transcoded and written as UTF-8.
Exceptions
The specified property name is too large.
Validation is enabled, and this write operation would produce invalid JSON.
Remarks
The property name is escaped before writing.