Utf8JsonWriter.WriteString 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
WriteString(JsonEncodedText, JsonEncodedText) |
Writes the pre-encoded property name and pre-encoded value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(JsonEncodedText, String) |
Writes the pre-encoded property name and string text value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(JsonEncodedText, ReadOnlySpan<Char>) |
Writes the pre-encoded property name and text value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(JsonEncodedText, ReadOnlySpan<Byte>) |
Writes the pre-encoded property name and UTF-8 text value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(JsonEncodedText, Guid) |
Writes the pre-encoded property name and Guid value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(JsonEncodedText, DateTimeOffset) |
Writes the pre-encoded property name and DateTimeOffset value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(JsonEncodedText, DateTime) |
Writes the pre-encoded property name and DateTime value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(String, JsonEncodedText) |
Writes the property name and pre-encoded value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(String, String) |
Writes a property name specified as a string and a string text value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(String, ReadOnlySpan<Char>) |
Writes a property name specified as a string and a UTF-16 text value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(String, ReadOnlySpan<Byte>) |
Writes a property name specified as a string and a UTF-8 text value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(String, DateTimeOffset) |
Writes a property name specified as a string and a DateTimeOffset value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(String, DateTime) |
Writes a property name specified as a string and a DateTime value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(String, Guid) |
Writes a property name specified as a string and a Guid value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(ReadOnlySpan<Char>, String) |
Writes a UTF-16 property name and string text value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(ReadOnlySpan<Byte>, DateTime) |
Writes a UTF-8 property name and a DateTime value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(ReadOnlySpan<Byte>, DateTimeOffset) |
Writes a UTF-8 property name and a DateTimeOffset value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(ReadOnlySpan<Char>, JsonEncodedText) |
Writes the property name and pre-encoded value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>) |
Writes a UTF-8 property name and UTF-8 text value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(ReadOnlySpan<Byte>, ReadOnlySpan<Char>) |
Writes a UTF-8 property name and UTF-16 text value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(ReadOnlySpan<Byte>, String) |
Writes a UTF-8 property name and string text value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(ReadOnlySpan<Byte>, Guid) |
Writes a UTF-8 property name and a Guid value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(ReadOnlySpan<Char>, DateTime) |
Writes a property name specified as a read-only character span and a DateTime value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(ReadOnlySpan<Char>, DateTimeOffset) |
Writes a property name specified as a read-only character span and a DateTimeOffset value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(ReadOnlySpan<Char>, Guid) |
Writes a property name specified as a read-only character span and a Guid value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(ReadOnlySpan<Char>, ReadOnlySpan<Byte>) |
Writes a UTF-16 property name and UTF-8 text value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(ReadOnlySpan<Char>, ReadOnlySpan<Char>) |
Writes a UTF-16 property name and UTF-16 text value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(ReadOnlySpan<Byte>, JsonEncodedText) |
Writes the UTF-8 property name and pre-encoded value (as a JSON string) as part of a name/value pair of a JSON object. |
WriteString(JsonEncodedText, JsonEncodedText)
Writes the pre-encoded property name and pre-encoded value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(System::Text::Json::JsonEncodedText propertyName, System::Text::Json::JsonEncodedText value);
public void WriteString (System.Text.Json.JsonEncodedText propertyName, System.Text.Json.JsonEncodedText value);
member this.WriteString : System.Text.Json.JsonEncodedText * System.Text.Json.JsonEncodedText -> unit
Public Sub WriteString (propertyName As JsonEncodedText, value As JsonEncodedText)
Parameters
- propertyName
- JsonEncodedText
The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.
- value
- JsonEncodedText
The JSON encoded value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.
Exceptions
Validation is enabled, and the write operation would produce invalid JSON.
Remarks
The property name and value should already be escaped when the instance of JsonEncodedText was created.
Applies to
WriteString(JsonEncodedText, String)
Writes the pre-encoded property name and string text value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(System::Text::Json::JsonEncodedText propertyName, System::String ^ value);
public void WriteString (System.Text.Json.JsonEncodedText propertyName, string? value);
public void WriteString (System.Text.Json.JsonEncodedText propertyName, string value);
member this.WriteString : System.Text.Json.JsonEncodedText * string -> unit
Public Sub WriteString (propertyName As JsonEncodedText, value As String)
Parameters
- propertyName
- JsonEncodedText
The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.
- value
- String
The value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.
Exceptions
The specified value is too large.
Validation is enabled, and the write operation would produce invalid JSON.
Remarks
The property name should already be escaped when the instance of JsonEncodedText was created.
The value is escaped before writing.
If value
is null
, the JSON null value is written, as if the WriteNull(JsonEncodedText) method was called.
Applies to
WriteString(JsonEncodedText, ReadOnlySpan<Char>)
Writes the pre-encoded property name and text value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(System::Text::Json::JsonEncodedText propertyName, ReadOnlySpan<char> value);
public void WriteString (System.Text.Json.JsonEncodedText propertyName, ReadOnlySpan<char> value);
member this.WriteString : System.Text.Json.JsonEncodedText * ReadOnlySpan<char> -> unit
Public Sub WriteString (propertyName As JsonEncodedText, value As ReadOnlySpan(Of Char))
Parameters
- propertyName
- JsonEncodedText
The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.
- value
- ReadOnlySpan<Char>
The value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.
Exceptions
The specified value is too large.
Validation is enabled, and the write operation would produce invalid JSON.
Remarks
The property name should already be escaped when the instance of JsonEncodedText was created.
The value is escaped before writing.
If value
is null
, the JSON null value is written, as if the WriteNull(JsonEncodedText) method was called.
Applies to
WriteString(JsonEncodedText, ReadOnlySpan<Byte>)
Writes the pre-encoded property name and UTF-8 text value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(System::Text::Json::JsonEncodedText propertyName, ReadOnlySpan<System::Byte> utf8Value);
public void WriteString (System.Text.Json.JsonEncodedText propertyName, ReadOnlySpan<byte> utf8Value);
member this.WriteString : System.Text.Json.JsonEncodedText * ReadOnlySpan<byte> -> unit
Public Sub WriteString (propertyName As JsonEncodedText, utf8Value As ReadOnlySpan(Of Byte))
Parameters
- propertyName
- JsonEncodedText
The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.
- utf8Value
- ReadOnlySpan<Byte>
The UTF-8 encoded value to be written as a JSON string as part of the name/value pair.
Exceptions
The specified value is too large.
Validation is enabled, and the write operation would produce invalid JSON.
Remarks
The property name should already be escaped when the instance of JsonEncodedText was created.
The value is escaped before writing.
Applies to
WriteString(JsonEncodedText, Guid)
Writes the pre-encoded property name and Guid value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(System::Text::Json::JsonEncodedText propertyName, Guid value);
public void WriteString (System.Text.Json.JsonEncodedText propertyName, Guid value);
member this.WriteString : System.Text.Json.JsonEncodedText * Guid -> unit
Public Sub WriteString (propertyName As JsonEncodedText, value As Guid)
Parameters
- propertyName
- JsonEncodedText
The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.
- value
- Guid
The value to be written as a JSON string as part of the name/value pair.
Exceptions
Validation is enabled, and the write operation would produce invalid JSON.
Remarks
Writes the Guid using the default StandardFormat (that is, 'D'), in the form: nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn.
The property name should already be escaped when the instance of JsonEncodedText was created.
Applies to
WriteString(JsonEncodedText, DateTimeOffset)
Writes the pre-encoded property name and DateTimeOffset value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(System::Text::Json::JsonEncodedText propertyName, DateTimeOffset value);
public void WriteString (System.Text.Json.JsonEncodedText propertyName, DateTimeOffset value);
member this.WriteString : System.Text.Json.JsonEncodedText * DateTimeOffset -> unit
Public Sub WriteString (propertyName As JsonEncodedText, value As DateTimeOffset)
Parameters
- propertyName
- JsonEncodedText
The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.
- value
- DateTimeOffset
The value to be written as a JSON string as part of the name/value pair.
Exceptions
Validation is enabled, and the write operation would produce invalid JSON.
Remarks
Writes the DateTimeOffset using the ISO 8601-1 extended format (see DateTime and DateTimeOffset support in System.Text.Json); for example, 2017-06-12T05:30:45.7680000-07:00.
The property name should already be escaped when the instance of JsonEncodedText was created.
Applies to
WriteString(JsonEncodedText, DateTime)
Writes the pre-encoded property name and DateTime value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(System::Text::Json::JsonEncodedText propertyName, DateTime value);
public void WriteString (System.Text.Json.JsonEncodedText propertyName, DateTime value);
member this.WriteString : System.Text.Json.JsonEncodedText * DateTime -> unit
Public Sub WriteString (propertyName As JsonEncodedText, value As DateTime)
Parameters
- propertyName
- JsonEncodedText
The JSON encoded property name of the JSON object to be transcoded and written as UTF-8.
- value
- DateTime
The value to be written as a JSON string as part of the name/value pair.
Exceptions
Validation is enabled, and the write operation would produce invalid JSON.
Remarks
Writes the DateTime using the ISO 8601-1 extended format (see DateTime and DateTimeOffset support in System.Text.Json); for example, 2017-06-12T05:30:45.7680000.
The property name should already be escaped when the instance of JsonEncodedText was created.
Applies to
WriteString(String, JsonEncodedText)
Writes the property name and pre-encoded value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(System::String ^ propertyName, System::Text::Json::JsonEncodedText value);
public void WriteString (string propertyName, System.Text.Json.JsonEncodedText value);
member this.WriteString : string * System.Text.Json.JsonEncodedText -> unit
Public Sub WriteString (propertyName As String, value As JsonEncodedText)
Parameters
- propertyName
- String
The property name of the JSON object to be transcoded and written as UTF-8.
- value
- JsonEncodedText
The JSON encoded value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.
Exceptions
The specified property name is too large.
Validation is enabled, and the write operation would produce invalid JSON.
The propertyName
parameter is null
.
Remarks
The value should already be escaped when the instance of JsonEncodedText was created.
The property name is escaped before writing.
Applies to
WriteString(String, String)
Writes a property name specified as a string and a string text value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(System::String ^ propertyName, System::String ^ value);
public void WriteString (string propertyName, string? value);
public void WriteString (string propertyName, string value);
member this.WriteString : string * string -> unit
Public Sub WriteString (propertyName As String, value As String)
Parameters
- propertyName
- String
The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.
- value
- String
The UTF-16 encoded value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.
Exceptions
The specified property name or value is too large.
Validation is enabled, and the write operation would produce invalid JSON.
The propertyName
parameter is null
.
Remarks
The property name and value are escaped before writing.
If value
is null
, the JSON null value is written, as if the WriteNull(String) method was called.
Applies to
WriteString(String, ReadOnlySpan<Char>)
Writes a property name specified as a string and a UTF-16 text value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(System::String ^ propertyName, ReadOnlySpan<char> value);
public void WriteString (string propertyName, ReadOnlySpan<char> value);
member this.WriteString : string * ReadOnlySpan<char> -> unit
Public Sub WriteString (propertyName As String, value As ReadOnlySpan(Of Char))
Parameters
- propertyName
- String
The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.
- value
- ReadOnlySpan<Char>
The UTF-16 encoded value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.
Exceptions
The specified property name or value is too large.
Validation is enabled, and the write operation would produce invalid JSON.
The propertyName
parameter is null
.
Remarks
The property name and value are escaped before writing.
Applies to
WriteString(String, ReadOnlySpan<Byte>)
Writes a property name specified as a string and a UTF-8 text value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(System::String ^ propertyName, ReadOnlySpan<System::Byte> utf8Value);
public void WriteString (string propertyName, ReadOnlySpan<byte> utf8Value);
member this.WriteString : string * ReadOnlySpan<byte> -> unit
Public Sub WriteString (propertyName As String, utf8Value As ReadOnlySpan(Of Byte))
Parameters
- propertyName
- String
The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.
- utf8Value
- ReadOnlySpan<Byte>
The UTF-8 encoded value to be written as a JSON string as part of the name/value pair.
Exceptions
The specified property name or value is too large.
Validation is enabled, and the write operation would produce invalid JSON.
The propertyName
parameter is null
.
Remarks
The property name and value are escaped before writing.
Applies to
WriteString(String, DateTimeOffset)
Writes a property name specified as a string and a DateTimeOffset value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(System::String ^ propertyName, DateTimeOffset value);
public void WriteString (string propertyName, DateTimeOffset value);
member this.WriteString : string * DateTimeOffset -> unit
Public Sub WriteString (propertyName As String, value As DateTimeOffset)
Parameters
- propertyName
- String
The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.
- value
- DateTimeOffset
The value to be written as a JSON string as part of the name/value pair.
Exceptions
The specified property name is too large.
Validation is enabled, and the write operation would produce invalid JSON.
The propertyName
parameter is null
.
Remarks
Writes the DateTimeOffset using the ISO 8601-1 extended format (see DateTime and DateTimeOffset support in System.Text.Json); for example, 2017-06-12T05:30:45.7680000-07:00.
The property name is escaped before writing.
Applies to
WriteString(String, DateTime)
Writes a property name specified as a string and a DateTime value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(System::String ^ propertyName, DateTime value);
public void WriteString (string propertyName, DateTime value);
member this.WriteString : string * DateTime -> unit
Public Sub WriteString (propertyName As String, value As DateTime)
Parameters
- propertyName
- String
The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.
- value
- DateTime
The value to be written as a JSON string as part of the name/value pair.
Exceptions
The specified property name is too large.
Validation is enabled, and the write operation would produce invalid JSON.
The propertyName
parameter is null
.
Remarks
Writes the DateTime using the ISO 8601-1 extended format (see DateTime and DateTimeOffset support in System.Text.Json); for example, 2017-06-12T05:30:45.7680000.
The property name is escaped before writing.
Applies to
WriteString(String, Guid)
Writes a property name specified as a string and a Guid value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(System::String ^ propertyName, Guid value);
public void WriteString (string propertyName, Guid value);
member this.WriteString : string * Guid -> unit
Public Sub WriteString (propertyName As String, value As Guid)
Parameters
- propertyName
- String
The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.
- value
- Guid
The value to be written as a JSON string as part of the name/value pair.
Exceptions
The specified property name is too large.
Validation is enabled, and the write operation would produce invalid JSON.
The propertyName
parameter is null
.
Remarks
Writes the Guid using the default StandardFormat (that is, 'D'), in the form: nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn. The property name is escaped before writing.
Applies to
WriteString(ReadOnlySpan<Char>, String)
Writes a UTF-16 property name and string text value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(ReadOnlySpan<char> propertyName, System::String ^ value);
public void WriteString (ReadOnlySpan<char> propertyName, string? value);
public void WriteString (ReadOnlySpan<char> propertyName, string value);
member this.WriteString : ReadOnlySpan<char> * string -> unit
Public Sub WriteString (propertyName As ReadOnlySpan(Of Char), value As String)
Parameters
- propertyName
- ReadOnlySpan<Char>
The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.
- value
- String
The UTF-16 encoded value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.
Exceptions
The specified property name or value is too large.
Validation is enabled, and the write operation would produce invalid JSON.
Remarks
The property name and value are escaped before writing.
If value
is null
, the JSON null value is written, as if the WriteNull(ReadOnlySpan<Char>) method was called.
Applies to
WriteString(ReadOnlySpan<Byte>, DateTime)
Writes a UTF-8 property name and a DateTime value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(ReadOnlySpan<System::Byte> utf8PropertyName, DateTime value);
public void WriteString (ReadOnlySpan<byte> utf8PropertyName, DateTime value);
member this.WriteString : ReadOnlySpan<byte> * DateTime -> unit
Public Sub WriteString (utf8PropertyName As ReadOnlySpan(Of Byte), value As DateTime)
Parameters
- utf8PropertyName
- ReadOnlySpan<Byte>
The UTF-8 encoded property name of the JSON object to be written.
- value
- DateTime
The value to be written as a JSON string as part of the name/value pair.
Exceptions
The specified property name is too large.
Validation is enabled, and the write operation would produce invalid JSON.
Remarks
Writes the DateTime using the ISO 8601-1 extended format (see DateTime and DateTimeOffset support in System.Text.Json); for example, 2017-06-12T05:30:45.7680000.
The property name is escaped before writing.
Applies to
WriteString(ReadOnlySpan<Byte>, DateTimeOffset)
Writes a UTF-8 property name and a DateTimeOffset value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(ReadOnlySpan<System::Byte> utf8PropertyName, DateTimeOffset value);
public void WriteString (ReadOnlySpan<byte> utf8PropertyName, DateTimeOffset value);
member this.WriteString : ReadOnlySpan<byte> * DateTimeOffset -> unit
Public Sub WriteString (utf8PropertyName As ReadOnlySpan(Of Byte), value As DateTimeOffset)
Parameters
- utf8PropertyName
- ReadOnlySpan<Byte>
The UTF-8 encoded property name of the JSON object to be written.
- value
- DateTimeOffset
The value to be written as a JSON string as part of the name/value pair.
Exceptions
The specified property name is too large.
Validation is enabled, and the write operation would produce invalid JSON.
Remarks
Writes the DateTimeOffset using the ISO 8601-1 extended format (see DateTime and DateTimeOffset support in System.Text.Json); for example, 2017-06-12T05:30:45.7680000-07:00.
The property name is escaped before writing.
Applies to
WriteString(ReadOnlySpan<Char>, JsonEncodedText)
Writes the property name and pre-encoded value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(ReadOnlySpan<char> propertyName, System::Text::Json::JsonEncodedText value);
public void WriteString (ReadOnlySpan<char> propertyName, System.Text.Json.JsonEncodedText value);
member this.WriteString : ReadOnlySpan<char> * System.Text.Json.JsonEncodedText -> unit
Public Sub WriteString (propertyName As ReadOnlySpan(Of Char), value As JsonEncodedText)
Parameters
- propertyName
- ReadOnlySpan<Char>
The property name of the JSON object to be transcoded and written as UTF-8.
- value
- JsonEncodedText
The JSON encoded value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.
Exceptions
The specified property name is too large.
Validation is enabled, and the write operation would produce invalid JSON.
Remarks
The value should already be escaped when the instance of JsonEncodedText was created.
The property name is escaped before writing.
Applies to
WriteString(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)
Writes a UTF-8 property name and UTF-8 text value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(ReadOnlySpan<System::Byte> utf8PropertyName, ReadOnlySpan<System::Byte> utf8Value);
public void WriteString (ReadOnlySpan<byte> utf8PropertyName, ReadOnlySpan<byte> utf8Value);
member this.WriteString : ReadOnlySpan<byte> * ReadOnlySpan<byte> -> unit
Public Sub WriteString (utf8PropertyName As ReadOnlySpan(Of Byte), utf8Value As ReadOnlySpan(Of Byte))
Parameters
- utf8PropertyName
- ReadOnlySpan<Byte>
The UTF-8 encoded property name of the JSON object to be written.
- utf8Value
- ReadOnlySpan<Byte>
The UTF-8 encoded value to be written as a JSON string as part of the name/value pair.
Exceptions
The specified property name or value is too large.
Validation is enabled, and the write operation would produce invalid JSON.
Remarks
The property name and value are escaped before writing.
Applies to
WriteString(ReadOnlySpan<Byte>, ReadOnlySpan<Char>)
Writes a UTF-8 property name and UTF-16 text value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(ReadOnlySpan<System::Byte> utf8PropertyName, ReadOnlySpan<char> value);
public void WriteString (ReadOnlySpan<byte> utf8PropertyName, ReadOnlySpan<char> value);
member this.WriteString : ReadOnlySpan<byte> * ReadOnlySpan<char> -> unit
Public Sub WriteString (utf8PropertyName As ReadOnlySpan(Of Byte), value As ReadOnlySpan(Of Char))
Parameters
- utf8PropertyName
- ReadOnlySpan<Byte>
The UTF-8 encoded property name of the JSON object to be written.
- value
- ReadOnlySpan<Char>
The UTF-16 encoded value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.
Exceptions
The specified property name or value is too large.
Validation is enabled, and the write operation would produce invalid JSON.
Remarks
The property name and value are escaped before writing.
Applies to
WriteString(ReadOnlySpan<Byte>, String)
Writes a UTF-8 property name and string text value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(ReadOnlySpan<System::Byte> utf8PropertyName, System::String ^ value);
public void WriteString (ReadOnlySpan<byte> utf8PropertyName, string? value);
public void WriteString (ReadOnlySpan<byte> utf8PropertyName, string value);
member this.WriteString : ReadOnlySpan<byte> * string -> unit
Public Sub WriteString (utf8PropertyName As ReadOnlySpan(Of Byte), value As String)
Parameters
- utf8PropertyName
- ReadOnlySpan<Byte>
The UTF-8 encoded property name of the JSON object to be written.
- value
- String
The UTF-16 encoded value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.
Exceptions
The specified property name or value is too large.
Validation is enabled, and the write operation would produce invalid JSON.
Remarks
The property name and value are escaped before writing.
If value
is null
, the JSON null value is written, as if the WriteNull(ReadOnlySpan<Byte>) method was called.
Applies to
WriteString(ReadOnlySpan<Byte>, Guid)
Writes a UTF-8 property name and a Guid value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(ReadOnlySpan<System::Byte> utf8PropertyName, Guid value);
public void WriteString (ReadOnlySpan<byte> utf8PropertyName, Guid value);
member this.WriteString : ReadOnlySpan<byte> * Guid -> unit
Public Sub WriteString (utf8PropertyName As ReadOnlySpan(Of Byte), value As Guid)
Parameters
- utf8PropertyName
- ReadOnlySpan<Byte>
The UTF-8 encoded property name of the JSON object to be written.
- value
- Guid
The value to be written as a JSON string as part of the name/value pair.
Exceptions
The specified property name is too large.
Validation is enabled, and the write operation would produce invalid JSON.
Remarks
Writes the Guid using the default StandardFormat (that is, 'D'), in the form: nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn. The property name is escaped before writing.
Applies to
WriteString(ReadOnlySpan<Char>, DateTime)
Writes a property name specified as a read-only character span and a DateTime value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(ReadOnlySpan<char> propertyName, DateTime value);
public void WriteString (ReadOnlySpan<char> propertyName, DateTime value);
member this.WriteString : ReadOnlySpan<char> * DateTime -> unit
Public Sub WriteString (propertyName As ReadOnlySpan(Of Char), value As DateTime)
Parameters
- propertyName
- ReadOnlySpan<Char>
The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.
- value
- DateTime
The value to be written as a JSON string as part of the name/value pair.
Exceptions
The specified property name is too large.
Validation is enabled, and the write operation would produce invalid JSON.
Remarks
Writes the DateTime using the ISO 8601-1 extended format (see DateTime and DateTimeOffset support in System.Text.Json); for example, 2017-06-12T05:30:45.7680000.
The property name is escaped before writing.
Applies to
WriteString(ReadOnlySpan<Char>, DateTimeOffset)
Writes a property name specified as a read-only character span and a DateTimeOffset value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(ReadOnlySpan<char> propertyName, DateTimeOffset value);
public void WriteString (ReadOnlySpan<char> propertyName, DateTimeOffset value);
member this.WriteString : ReadOnlySpan<char> * DateTimeOffset -> unit
Public Sub WriteString (propertyName As ReadOnlySpan(Of Char), value As DateTimeOffset)
Parameters
- propertyName
- ReadOnlySpan<Char>
The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.
- value
- DateTimeOffset
The value to be written as a JSON string as part of the name/value pair.
Exceptions
The specified property name is too large.
Validation is enabled, and the write operation would produce invalid JSON.
Remarks
Writes the DateTimeOffset using the ISO 8601-1 extended format (see DateTime and DateTimeOffset support in System.Text.Json); for example, 2017-06-12T05:30:45.7680000-07:00.
The property name is escaped before writing.
Applies to
WriteString(ReadOnlySpan<Char>, Guid)
Writes a property name specified as a read-only character span and a Guid value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(ReadOnlySpan<char> propertyName, Guid value);
public void WriteString (ReadOnlySpan<char> propertyName, Guid value);
member this.WriteString : ReadOnlySpan<char> * Guid -> unit
Public Sub WriteString (propertyName As ReadOnlySpan(Of Char), value As Guid)
Parameters
- propertyName
- ReadOnlySpan<Char>
The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.
- value
- Guid
The value to be written as a JSON string as part of the name/value pair.
Exceptions
The specified property name is too large.
Validation is enabled, and the write operation would produce invalid JSON.
Remarks
Writes the Guid using the default StandardFormat (that is, 'D'), in the form: nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn. The property name is escaped before writing.
Applies to
WriteString(ReadOnlySpan<Char>, ReadOnlySpan<Byte>)
Writes a UTF-16 property name and UTF-8 text value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(ReadOnlySpan<char> propertyName, ReadOnlySpan<System::Byte> utf8Value);
public void WriteString (ReadOnlySpan<char> propertyName, ReadOnlySpan<byte> utf8Value);
member this.WriteString : ReadOnlySpan<char> * ReadOnlySpan<byte> -> unit
Public Sub WriteString (propertyName As ReadOnlySpan(Of Char), utf8Value As ReadOnlySpan(Of Byte))
Parameters
- propertyName
- ReadOnlySpan<Char>
The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.
- utf8Value
- ReadOnlySpan<Byte>
The UTF-8 encoded value to be written as a JSON string as part of the name/value pair.
Exceptions
The specified property name or value is too large.
Validation is enabled, and the write operation would produce invalid JSON.
Remarks
The property name and value are escaped before writing.
Applies to
WriteString(ReadOnlySpan<Char>, ReadOnlySpan<Char>)
Writes a UTF-16 property name and UTF-16 text value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(ReadOnlySpan<char> propertyName, ReadOnlySpan<char> value);
public void WriteString (ReadOnlySpan<char> propertyName, ReadOnlySpan<char> value);
member this.WriteString : ReadOnlySpan<char> * ReadOnlySpan<char> -> unit
Public Sub WriteString (propertyName As ReadOnlySpan(Of Char), value As ReadOnlySpan(Of Char))
Parameters
- propertyName
- ReadOnlySpan<Char>
The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.
- value
- ReadOnlySpan<Char>
The UTF-16 encoded value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.
Exceptions
The specified property name or value is too large.
Validation is enabled, and the write operation would produce invalid JSON.
Remarks
The property name and value are escaped before writing.
Applies to
WriteString(ReadOnlySpan<Byte>, JsonEncodedText)
Writes the UTF-8 property name and pre-encoded value (as a JSON string) as part of a name/value pair of a JSON object.
public:
void WriteString(ReadOnlySpan<System::Byte> utf8PropertyName, System::Text::Json::JsonEncodedText value);
public void WriteString (ReadOnlySpan<byte> utf8PropertyName, System.Text.Json.JsonEncodedText value);
member this.WriteString : ReadOnlySpan<byte> * System.Text.Json.JsonEncodedText -> unit
Public Sub WriteString (utf8PropertyName As ReadOnlySpan(Of Byte), value As JsonEncodedText)
Parameters
- utf8PropertyName
- ReadOnlySpan<Byte>
The UTF-8 encoded property name of the JSON object to be written.
- value
- JsonEncodedText
The JSON encoded value to be written as a UTF-8 transcoded JSON string as part of the name/value pair.
Exceptions
The specified property name is too large.
Validation is enabled, and this method would result in writing invalid JSON.
Remarks
The value should already be escaped when the instance of JsonEncodedText was created.
The property name is escaped before writing.